equal
deleted
inserted
replaced
66 pub(super) fn state(&self) -> Option<EntryState> { |
66 pub(super) fn state(&self) -> Option<EntryState> { |
67 self.entry.as_ref().map(|entry| entry.state) |
67 self.entry.as_ref().map(|entry| entry.state) |
68 } |
68 } |
69 |
69 |
70 pub(super) fn sorted<'tree>( |
70 pub(super) fn sorted<'tree>( |
71 nodes: &'tree mut ChildNodes<'on_disk>, |
71 nodes: &'tree ChildNodes<'on_disk>, |
72 ) -> Vec<(&'tree NodeKey<'on_disk>, &'tree mut Self)> { |
72 ) -> Vec<(&'tree NodeKey<'on_disk>, &'tree Self)> { |
73 let mut vec: Vec<_> = nodes.iter_mut().collect(); |
73 let mut vec: Vec<_> = nodes.iter().collect(); |
74 // `sort_unstable_by_key` doesn’t allow keys borrowing from the value: |
74 // `sort_unstable_by_key` doesn’t allow keys borrowing from the value: |
75 // https://github.com/rust-lang/rust/issues/34162 |
75 // https://github.com/rust-lang/rust/issues/34162 |
76 vec.sort_unstable_by(|(path1, _), (path2, _)| path1.cmp(path2)); |
76 vec.sort_unstable_by(|(path1, _), (path2, _)| path1.cmp(path2)); |
77 vec |
77 vec |
78 } |
78 } |