Skip to content

Commit

Permalink
Simplify contains / insert
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Jan 3, 2024
1 parent 487959e commit 376f39c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/ruff_notebook/src/notebook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ impl Notebook {
.as_hyphenated()
.to_string();

if !existing_ids.contains(&new_id) {
existing_ids.insert(new_id.clone());
if existing_ids.insert(new_id.clone()) {
*id = Some(new_id);
break;
}
Expand Down

0 comments on commit 376f39c

Please sign in to comment.