Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
kafonek committed Jan 13, 2024
1 parent 61b38b9 commit f2930fe
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/notebook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,11 @@ impl Notebook {
}

pub fn get_cell(&self, id: &str) -> Option<&Cell> {
for cell in self.cells.iter() {
if cell.id() == id {
return Some(cell);
}
}
None
self.cells.iter().find(|&cell| cell.id() == id)
}

pub fn get_mut_cell(&mut self, id: &str) -> Option<&mut Cell> {
for cell in self.cells.iter_mut() {
if cell.id() == id {
return Some(cell);
}
}
None
self.cells.iter_mut().find(|cell| cell.id() == id)
}

pub fn add_cell(&mut self, cell: Cell) {
Expand Down

0 comments on commit f2930fe

Please # to comment.