From a80758ee1dd7276b72986eb743ebfa7d108d06d3 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Wed, 19 Jul 2023 12:11:27 +0900 Subject: [PATCH] revset_graph: remove redundant boxing from reverse iterator constructor --- lib/src/revset_graph.rs | 4 +--- src/commands/mod.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/src/revset_graph.rs b/lib/src/revset_graph.rs index 952fb93fe..c1bc51d84 100644 --- a/lib/src/revset_graph.rs +++ b/lib/src/revset_graph.rs @@ -66,9 +66,7 @@ pub struct ReverseRevsetGraphIterator { } impl ReverseRevsetGraphIterator { - pub fn new<'revset>( - input: Box)> + 'revset>, - ) -> Self { + pub fn new(input: impl IntoIterator)>) -> Self { let mut entries = vec![]; let mut reverse_edges: HashMap> = HashMap::new(); for (commit_id, edges) in input { diff --git a/src/commands/mod.rs b/src/commands/mod.rs index e7f326bd9..df17fda73 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -1591,7 +1591,7 @@ fn cmd_log(ui: &mut Ui, command: &CommandHelper, args: &LogArgs) -> Result<(), C let default_node_symbol = graph.default_node_symbol().to_owned(); let forward_iter = TopoGroupedRevsetGraphIterator::new(revset.iter_graph()); let iter: Box> = if args.reversed { - Box::new(ReverseRevsetGraphIterator::new(Box::new(forward_iter))) + Box::new(ReverseRevsetGraphIterator::new(forward_iter)) } else { Box::new(forward_iter) };