revset_graph: remove redundant boxing from reverse iterator constructor

This commit is contained in:
Yuya Nishihara 2023-07-19 12:11:27 +09:00
parent a382e96168
commit a80758ee1d
2 changed files with 2 additions and 4 deletions

View file

@ -66,9 +66,7 @@ pub struct ReverseRevsetGraphIterator {
}
impl ReverseRevsetGraphIterator {
pub fn new<'revset>(
input: Box<dyn Iterator<Item = (CommitId, Vec<RevsetGraphEdge>)> + 'revset>,
) -> Self {
pub fn new(input: impl IntoIterator<Item = (CommitId, Vec<RevsetGraphEdge>)>) -> Self {
let mut entries = vec![];
let mut reverse_edges: HashMap<CommitId, Vec<RevsetGraphEdge>> = HashMap::new();
for (commit_id, edges) in input {

View file

@ -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<dyn Iterator<Item = _>> = if args.reversed {
Box::new(ReverseRevsetGraphIterator::new(Box::new(forward_iter)))
Box::new(ReverseRevsetGraphIterator::new(forward_iter))
} else {
Box::new(forward_iter)
};