[−][src]Function fsio::path::canonicalize_as_string
pub fn canonicalize_as_string<T: AsPath + ?Sized>(
path: &T
) -> Result<String, FsIOError>
Returns a canonicalized string from the provided path value.
Arguments
path
- The path value
Example
extern crate fsio; use fsio::path; use fsio::path::as_path::AsPath; use std::path::Path; fn main() { let path_obj = Path::new("./src/path/mod.rs"); let path1 = path::canonicalize_as_string(&path_obj); let path2 = path::canonicalize_as_string(&"./src/path/mod.rs".to_string()); assert_eq!(path1.unwrap(), path2.unwrap()); }