Remove IndexUid::new and replace with IndexUid::from_str

This commit is contained in:
walter 2022-06-08 19:56:01 -04:00
parent ba55905377
commit 2b944ecd89
2 changed files with 3 additions and 13 deletions

View file

@ -48,18 +48,6 @@ pub fn create_index_resolver(
}
impl IndexUid {
pub fn new(uid: String) -> Result<Self> {
if !uid
.chars()
.all(|x| x.is_ascii_alphanumeric() || x == '-' || x == '_')
|| !(1..=400).contains(&uid.len())
{
Err(IndexResolverError::BadlyFormatted(uid))
} else {
Ok(Self(uid))
}
}
pub fn new_unchecked(s: impl AsRef<str>) -> Self {
Self(s.as_ref().to_string())
}