Skip to content

Commit ec63f9d

Browse files
committed
Added the note to Metadata too
1 parent 93cbad6 commit ec63f9d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libstd/fs.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,12 @@ impl Metadata {
10331033
/// [`is_dir`], and will be false for symlink metadata
10341034
/// obtained from [`symlink_metadata`].
10351035
///
1036+
/// This property means it is often more useful to use `!file_type.is_dir()`
1037+
/// than `file_type.is_file()` when your goal is to read bytes from a
1038+
/// source: the former includes symlink and pipes when the latter does not,
1039+
/// meaning you will break workflows like `diff <( prog_a ) <( prog_b )` on
1040+
/// a Unix-like system for example.
1041+
///
10361042
/// [`is_dir`]: struct.Metadata.html#method.is_dir
10371043
/// [`symlink_metadata`]: fn.symlink_metadata.html
10381044
///

0 commit comments

Comments
 (0)