File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 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<()> {
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/// ```
You can’t perform that action at this time.
0 commit comments