rust-clippy: refactor complex type
authorRaphaël Gomès <rgomes@octobus.net>
Mon, 09 Jan 2023 18:50:29 +0100
changeset 49925 49131579db62
parent 49924 66ffe3749a48
child 49926 0780371d6b1e
rust-clippy: refactor complex type This makes reading the signature a bit less tiring.
rust/hg-core/src/operations/cat.rs
--- a/rust/hg-core/src/operations/cat.rs	Mon Jan 09 18:30:42 2023 +0100
+++ b/rust/hg-core/src/operations/cat.rs	Mon Jan 09 18:50:29 2023 +0100
@@ -53,10 +53,13 @@
     }
 }
 
+// Tuple of (missing, found) paths in the manifest
+type ManifestQueryResponse<'a> = (Vec<(&'a HgPath, Node)>, Vec<&'a HgPath>);
+
 fn find_files_in_manifest<'query>(
     manifest: &Manifest,
     query: impl Iterator<Item = &'query HgPath>,
-) -> Result<(Vec<(&'query HgPath, Node)>, Vec<&'query HgPath>), HgError> {
+) -> Result<ManifestQueryResponse<'query>, HgError> {
     let mut manifest = put_back(manifest.iter());
     let mut res = vec![];
     let mut missing = vec![];