about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAli Raheem <github@hadoken.cc>2019-09-09 20:38:21 +0100
committerAli Raheem <github@hadoken.cc>2019-09-09 20:38:21 +0100
commit1161aeb2b423da744e687315648a49cc4774220b (patch)
tree2579396b10bdfad9a56f2182760b3d7b18108da2
parent3c820fef9fafca1f25da37274aea683b9e341339 (diff)
downloadrust-1161aeb2b423da744e687315648a49cc4774220b.tar.gz
rust-1161aeb2b423da744e687315648a49cc4774220b.zip
Replace println statements with explanatory comments
-rw-r--r--src/libstd/fs.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs
index 689c50c6b80..246587b4233 100644
--- a/src/libstd/fs.rs
+++ b/src/libstd/fs.rs
@@ -2002,20 +2002,17 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
 /// use std::{fs, io};
 ///
 /// fn main() -> io::Result<()> {
-///     // The order in which `read_dir` returns entries is not guaranteed. If reproducible
-///     // ordering is required the entries should be explicitly sorted.
 ///     let mut entries = fs::read_dir(".")?
 ///         .map(|res| res.map(|e| e.path()))
 ///         .collect::<Result<Vec<_>, io::Error>>()?;
 ///
-///     // println!(
-///     //     "Entries before sorting (may or may not be sorted already): {:?}",
-///     //     entries
-///     // );
+///     // The order in which `read_dir` returns entries is not guaranteed. If reproducible
+///     // ordering is required the entries should be explicitly sorted.
 ///
 ///     entries.sort();
 ///
-///     // println!("Entries after sorting: {:?}", entries);
+///     // The entries have now been sorted by their path.
+///
 ///     Ok(())
 /// }
 /// ```