File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1007,17 +1007,18 @@ impl Metadata {
10071007 self . file_type ( ) . is_file ( )
10081008 }
10091009
1010- /// Returns `true` if this metadata is for a symbolic link file .
1010+ /// Returns `true` if this metadata is for a symbolic link.
10111011 ///
10121012 /// # Examples
10131013 ///
10141014 /// ```no_run
1015+ /// #![feature(is_symlink)]
10151016 /// use std::fs;
10161017 /// use std::path::Path;
10171018 /// use std::os::unix::fs::symlink;
10181019 ///
10191020 /// fn main() -> std::io::Result<()> {
1020- /// let link_path = Path::new("/ link");
1021+ /// let link_path = Path::new("link");
10211022 /// symlink("/origin_does_not_exists/", link_path)?;
10221023 ///
10231024 /// let metadata = fs::symlink_metadata(link_path)?;
Original file line number Diff line number Diff line change @@ -2568,23 +2568,24 @@ impl Path {
25682568 fs:: metadata ( self ) . map ( |m| m. is_dir ( ) ) . unwrap_or ( false )
25692569 }
25702570
2571- /// Returns true if the path exists on disk and is pointing at a symbolic link file .
2571+ /// Returns true if the path exists on disk and is pointing at a symbolic link.
25722572 /// This method can alse be used to check whether symlink exists.
25732573 ///
25742574 /// This function will not traverse symbolic links.
2575- /// In case of broken symbolic links this will also return true.
2575+ /// In case of a broken symbolic link this will also return true.
25762576 ///
25772577 /// If you cannot access the directory containing the file, e.g., because of a
25782578 /// permission error, this will return false.
25792579 ///
25802580 /// # Examples
25812581 ///
25822582 /// ```no_run
2583+ /// #![feature(is_symlink)]
25832584 /// use std::path::Path;
25842585 /// use std::os::unix::fs::symlink;
25852586 ///
2586- /// let link_path = Path::new("/ link");
2587- /// symlink("/origin_does_not_exists/", link_path)? ;
2587+ /// let link_path = Path::new("link");
2588+ /// symlink("/origin_does_not_exists/", link_path).unwrap() ;
25882589 /// assert_eq!(link_path.is_symlink(), true);
25892590 /// assert_eq!(link_path.exists(), false);
25902591 /// ```
You can’t perform that action at this time.
0 commit comments