mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
Remove IndexUid::new and replace with IndexUid::from_str
This commit is contained in:
parent
ba55905377
commit
2b944ecd89
2 changed files with 3 additions and 13 deletions
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue