file-storage 0.9.0

This library aids in accessing file-like storage.
Documentation
use crate::{FilePath, FolderPath, StoragePath};

#[allow(clippy::len_without_is_empty)]
impl StoragePath {
    //! Length

    /// Gets the path length. (in bytes)
    pub fn len(&self) -> usize {
        self.path().len()
    }
}

#[allow(clippy::len_without_is_empty)]
impl FilePath {
    //! Length

    /// Gets the path length. (in bytes)
    pub fn len(&self) -> usize {
        self.path().len()
    }
}

#[allow(clippy::len_without_is_empty)]
impl FolderPath {
    //! Length

    /// Gets the path length. (in bytes)
    pub fn len(&self) -> usize {
        self.path().len()
    }
}

#[cfg(test)]
mod tests {
    use crate::StoragePath;

    #[test]
    fn len() {
        let path: StoragePath = unsafe { StoragePath::new("/你/好", 1, '/') };
        assert_eq!(path.len(), 8);
    }
}