Mercurial > hg
comparison rust/hg-core/src/dagops.rs @ 51120:532e74ad3ff6
rust: run a clippy pass with the latest stable version
Our current version of clippy is older than the latest stable.
The newest version has new lints that are moslty good advice, so let's apply
them ahead of time. This has the added benefit of reducing the noise for
developpers like myself that use clippy as an IDE helper, as well as being
more prepared for a future clippy upgrade.
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Mon, 06 Nov 2023 11:06:08 +0100 |
parents | 4c5f6e95df84 |
children | ed6683d4cb29 |
comparison
equal
deleted
inserted
replaced
51119:d58e754f2db0 | 51120:532e74ad3ff6 |
---|---|
203 /// Apply `heads()` to the given slice and return as a sorted `Vec` | 203 /// Apply `heads()` to the given slice and return as a sorted `Vec` |
204 fn heads_sorted( | 204 fn heads_sorted( |
205 graph: &impl Graph, | 205 graph: &impl Graph, |
206 revs: &[BaseRevision], | 206 revs: &[BaseRevision], |
207 ) -> Result<Vec<Revision>, GraphError> { | 207 ) -> Result<Vec<Revision>, GraphError> { |
208 let iter_revs: Vec<_> = | 208 let iter_revs: Vec<_> = revs.iter().cloned().map(Revision).collect(); |
209 revs.into_iter().cloned().map(Revision).collect(); | |
210 let heads = heads(graph, iter_revs.iter())?; | 209 let heads = heads(graph, iter_revs.iter())?; |
211 let mut as_vec: Vec<Revision> = heads.iter().cloned().collect(); | 210 let mut as_vec: Vec<Revision> = heads.iter().cloned().collect(); |
212 as_vec.sort_unstable(); | 211 as_vec.sort_unstable(); |
213 Ok(as_vec) | 212 Ok(as_vec) |
214 } | 213 } |