Skip to content

Commit

Permalink
Replace println statements with explanatory comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Raheem committed Sep 9, 2019
1 parent 3c820fe commit 1161aeb
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/libstd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
/// }
/// ```
Expand Down

0 comments on commit 1161aeb

Please sign in to comment.