Relax type of return value

This commit is contained in:
Hanno Braun 2024-12-11 21:13:16 +01:00
parent 9a2c311d18
commit c0c5a281fd

View File

@ -24,13 +24,13 @@ impl OperationView {
} }
} }
pub fn operations(&self) -> Vec<(Self, bool, usize)> { pub fn operations(&self) -> Vec<(&Self, bool, usize)> {
iter::once((self.clone(), true, 0)) iter::once((self, true, 0))
.chain( .chain(
self.children self.children
.iter() .iter()
.enumerate() .enumerate()
.map(|(i, op)| (op.clone(), Some(i) == self.selected, 1)), .map(|(i, op)| (op, Some(i) == self.selected, 1)),
) )
.collect() .collect()
} }
@ -58,6 +58,7 @@ impl OperationView {
.into_iter() .into_iter()
.nth(selected) .nth(selected)
.map(|(op, _, _)| op) .map(|(op, _, _)| op)
.cloned()
}) })
.unwrap_or(self.clone()) .unwrap_or(self.clone())
} }