This commit is contained in:
sxyazi 2025-09-21 10:54:49 +08:00
parent cca2eebb9b
commit b0a3174683
No known key found for this signature in database
2 changed files with 5 additions and 3 deletions

View file

@ -19,4 +19,6 @@ hashbrown = { workspace = true }
serde = { workspace = true }
tokio = { workspace = true }
toml = { workspace = true }
uzers = { workspace = true }
[target."cfg(unix)".dependencies]
uzers = { workspace = true }

View file

@ -50,9 +50,9 @@ impl Vfs {
pub(crate) fn reshape(self) -> io::Result<Self> {
for name in self.providers.keys() {
if name.is_empty() || name.len() > 20 {
Err(io::Error::other("VFS name `{name}` must be between 1 and 20 characters"))?;
Err(io::Error::other(format!("VFS name `{name}` must be between 1 and 20 characters")))?;
} else if !name.bytes().all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'z' | b'-')) {
Err(io::Error::other("VFS name `{name}` must be in kebab-case"))?;
Err(io::Error::other(format!("VFS name `{name}` must be in kebab-case")))?;
}
}