refactor(clippy): adapt to new lints
This commit is contained in:
+1
-1
@@ -55,7 +55,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
terminal.draw(|f| {
|
||||
let area = f.size();
|
||||
|
||||
let items = Tree::new(app.tree.items.to_vec())
|
||||
let items = Tree::new(app.tree.items.clone())
|
||||
.block(
|
||||
Block::default()
|
||||
.borders(Borders::ALL)
|
||||
|
||||
@@ -44,6 +44,7 @@ impl Events {
|
||||
let tx = tx.clone();
|
||||
thread::spawn(move || {
|
||||
let stdin = io::stdin();
|
||||
#[allow(clippy::manual_flatten)]
|
||||
for evt in stdin.keys() {
|
||||
if let Ok(key) = evt {
|
||||
if let Err(err) = tx.send(Event::Input(key)) {
|
||||
|
||||
@@ -37,7 +37,7 @@ impl<'a> StatefulTree<'a> {
|
||||
}
|
||||
.min(visible.len() - 1)
|
||||
});
|
||||
let new_identifier = visible.get(new_index).unwrap().identifier.to_owned();
|
||||
let new_identifier = visible.get(new_index).unwrap().identifier.clone();
|
||||
self.state.select(new_identifier);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ fn internal<'a>(
|
||||
|
||||
result.push(Flattened {
|
||||
item,
|
||||
identifier: child_identifier.to_vec(),
|
||||
identifier: child_identifier.clone(),
|
||||
});
|
||||
|
||||
if opened.contains(&child_identifier) {
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ impl Default for TreeState {
|
||||
|
||||
impl TreeState {
|
||||
pub fn selected(&self) -> Vec<usize> {
|
||||
self.selected.to_owned()
|
||||
self.selected.clone()
|
||||
}
|
||||
|
||||
pub fn select<I>(&mut self, identifier: I)
|
||||
|
||||
Reference in New Issue
Block a user