file_storage/path/properties/
len.rs1use crate::{FilePath, FolderPath, StoragePath};
2
3#[allow(clippy::len_without_is_empty)]
4impl StoragePath {
5 pub fn len(&self) -> usize {
9 self.path().len()
10 }
11}
12
13#[allow(clippy::len_without_is_empty)]
14impl FilePath {
15 pub fn len(&self) -> usize {
19 self.path().len()
20 }
21}
22
23#[allow(clippy::len_without_is_empty)]
24impl FolderPath {
25 pub fn len(&self) -> usize {
29 self.path().len()
30 }
31}
32
33#[cfg(test)]
34mod tests {
35 use crate::StoragePath;
36
37 #[test]
38 fn len() {
39 let path: StoragePath = unsafe { StoragePath::new("/你/好", 1, '/') };
40 assert_eq!(path.len(), 8);
41 }
42}