File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1007,17 +1007,18 @@ impl Metadata {
1007
1007
self . file_type ( ) . is_file ( )
1008
1008
}
1009
1009
1010
- /// Returns `true` if this metadata is for a symbolic link file .
1010
+ /// Returns `true` if this metadata is for a symbolic link.
1011
1011
///
1012
1012
/// # Examples
1013
1013
///
1014
1014
/// ```no_run
1015
+ /// #![feature(is_symlink)]
1015
1016
/// use std::fs;
1016
1017
/// use std::path::Path;
1017
1018
/// use std::os::unix::fs::symlink;
1018
1019
///
1019
1020
/// fn main() -> std::io::Result<()> {
1020
- /// let link_path = Path::new("/ link");
1021
+ /// let link_path = Path::new("link");
1021
1022
/// symlink("/origin_does_not_exists/", link_path)?;
1022
1023
///
1023
1024
/// let metadata = fs::symlink_metadata(link_path)?;
Original file line number Diff line number Diff line change @@ -2568,23 +2568,24 @@ impl Path {
2568
2568
fs:: metadata ( self ) . map ( |m| m. is_dir ( ) ) . unwrap_or ( false )
2569
2569
}
2570
2570
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.
2572
2572
/// This method can alse be used to check whether symlink exists.
2573
2573
///
2574
2574
/// 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.
2576
2576
///
2577
2577
/// If you cannot access the directory containing the file, e.g., because of a
2578
2578
/// permission error, this will return false.
2579
2579
///
2580
2580
/// # Examples
2581
2581
///
2582
2582
/// ```no_run
2583
+ /// #![feature(is_symlink)]
2583
2584
/// use std::path::Path;
2584
2585
/// use std::os::unix::fs::symlink;
2585
2586
///
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() ;
2588
2589
/// assert_eq!(link_path.is_symlink(), true);
2589
2590
/// assert_eq!(link_path.exists(), false);
2590
2591
/// ```
You can’t perform that action at this time.
0 commit comments