Skip to content

Commit 1161aeb

Browse files
author
Ali Raheem
committed
Replace println statements with explanatory comments
1 parent 3c820fe commit 1161aeb

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/libstd/fs.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -2002,20 +2002,17 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
20022002
/// use std::{fs, io};
20032003
///
20042004
/// fn main() -> io::Result<()> {
2005-
/// // The order in which `read_dir` returns entries is not guaranteed. If reproducible
2006-
/// // ordering is required the entries should be explicitly sorted.
20072005
/// let mut entries = fs::read_dir(".")?
20082006
/// .map(|res| res.map(|e| e.path()))
20092007
/// .collect::<Result<Vec<_>, io::Error>>()?;
20102008
///
2011-
/// // println!(
2012-
/// // "Entries before sorting (may or may not be sorted already): {:?}",
2013-
/// // entries
2014-
/// // );
2009+
/// // The order in which `read_dir` returns entries is not guaranteed. If reproducible
2010+
/// // ordering is required the entries should be explicitly sorted.
20152011
///
20162012
/// entries.sort();
20172013
///
2018-
/// // println!("Entries after sorting: {:?}", entries);
2014+
/// // The entries have now been sorted by their path.
2015+
///
20192016
/// Ok(())
20202017
/// }
20212018
/// ```

0 commit comments

Comments
 (0)