Skip to content
Myr

make DirEntry Ord

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jonathan Goren · committed by Jonathan Goren · parent 47e30d3 · Browse files · 2 files+24 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+24 added−1 removed

  • other:+24 added−1 removed

2 files+24 added−1 removed

modified:src/dir_entry.rs+23 added
14 unmodified lines
15 metadata: OnceCell<Option<Metadata>>,16}1718impl DirEntry {19 #[inline]20 pub fn normal(e: ignore::DirEntry) -> Self {21 Self {22 inner: DirEntryInner::Normal(e),23 metadata: OnceCell::new(),
43 unmodified lines
67 DirEntryInner::BrokenSymlink(_) => None,68 }69 }70}7172impl PartialEq for DirEntry {73 #[inline]74 fn eq(&self, other: &Self) -> bool {75 self.path() == other.path()76 }77}78impl Eq for DirEntry {}7980impl PartialOrd for DirEntry {81 #[inline]82 fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {83 self.path().partial_cmp(other.path())84 }85}8687impl Ord for DirEntry {88 #[inline]89 fn cmp(&self, other: &Self) -> std::cmp::Ordering {90 self.path().cmp(other.path())91 }92}
modified:src/walk.rs+1 added-1 removed
308 unmodified lines
309310 /// Stop looping.311 fn stop(&mut self) -> Result<(), ExitCode> {312 if self.mode == ReceiverMode::Buffering {313 self.buffer.sort_by(|e1, e2| e1.path().cmp(e2.path()));313 self.buffer.sort();314 self.stream()?;315 }316317 if self.config.quiet {
245 unmodified lines