file-storage 0.9.0

This library aids in accessing file-like storage.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::{Error, FolderPath, StoragePath};
use std::io;

impl FolderPath {
    //! Current Working Directory

    /// Gets the current working directory.
    pub fn current_working_directory() -> Result<Self, io::Error> {
        let path: std::path::PathBuf = std::env::current_dir()?;
        match path.into_os_string().into_string() {
            Ok(path) => Ok(StoragePath::parse(path)?.make_folder()),
            Err(os) => Err(Error::path_not_utf8(os.as_ref())),
        }
    }
}