File tree 1 file changed +11
-7
lines changed
1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -48,15 +48,19 @@ static TILDE: Lazy<&OsStr> = Lazy::new(|| OsStr::new("~"));
48
48
/// # Examples
49
49
///
50
50
/// ```
51
- /// use lib::path::ExtendedPath
51
+ /// use lib::path::{ExtendedPath, PathError};
52
+ /// use std::path::Path;
52
53
///
53
- /// let path = path::Path("./example/../example.txt");
54
- /// let cleaned_path = path.clean();
55
- /// println!("cleaned path: {}", cleaned_path);
54
+ /// fn main() -> Result<(), PathError> {
55
+ /// let path = Path::new("./src/../Cargo.toml");
56
+ /// let cleaned_path = path.clean()?;
57
+ /// println!("cleaned path: {:?}", cleaned_path);
56
58
///
57
- /// let path = path::Path("~/example.txt");
58
- /// let expanded_path = path.expand_env();
59
- /// println!("expanded env path: {}", expanded_path);
59
+ /// let path = Path::new("~/.cargo");
60
+ /// let expanded_path = path.expand_env()?;
61
+ /// println!("expanded env path: {:?}", expanded_path);
62
+ /// Ok(())
63
+ /// }
60
64
/// ```
61
65
pub trait ExtendedPath {
62
66
fn clean ( & self ) -> Result < PathBuf , PathError > ;
You can’t perform that action at this time.
0 commit comments