mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 13:24:27 +01:00
Change the index uid format check for better legibility
This commit is contained in:
parent
3e5d6be86b
commit
96d4fd54bb
@ -110,7 +110,8 @@ impl FromStr for IndexUid {
|
|||||||
if !uid
|
if !uid
|
||||||
.chars()
|
.chars()
|
||||||
.all(|x| x.is_ascii_alphanumeric() || x == '-' || x == '_')
|
.all(|x| x.is_ascii_alphanumeric() || x == '-' || x == '_')
|
||||||
|| !(1..=400).contains(&uid.len())
|
|| uid.is_empty()
|
||||||
|
|| uid.len() > 400
|
||||||
{
|
{
|
||||||
Err(IndexUidFormatError {
|
Err(IndexUidFormatError {
|
||||||
invalid_uid: uid.to_string(),
|
invalid_uid: uid.to_string(),
|
||||||
|
Loading…
Reference in New Issue
Block a user