File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -2002,20 +2002,17 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
2002
2002
/// use std::{fs, io};
2003
2003
///
2004
2004
/// 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.
2007
2005
/// let mut entries = fs::read_dir(".")?
2008
2006
/// .map(|res| res.map(|e| e.path()))
2009
2007
/// .collect::<Result<Vec<_>, io::Error>>()?;
2010
2008
///
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.
2015
2011
///
2016
2012
/// entries.sort();
2017
2013
///
2018
- /// // println!("Entries after sorting: {:?}", entries);
2014
+ /// // The entries have now been sorted by their path.
2015
+ ///
2019
2016
/// Ok(())
2020
2017
/// }
2021
2018
/// ```
You can’t perform that action at this time.
0 commit comments