Skip to content

Commit

Permalink
Clippy fixes for 1.84.
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare committed Jan 10, 2025
1 parent 32defdb commit 2885125
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions candle-core/src/strided_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ impl Iterator for StridedIndex<'_> {
type Item = usize;

fn next(&mut self) -> Option<Self::Item> {
let storage_index = match self.next_storage_index {
None => return None,
Some(storage_index) => storage_index,
};
let storage_index = self.next_storage_index?;
let mut updated = false;
let mut next_storage_index = storage_index;
for ((multi_i, max_i), stride_i) in self
Expand Down
4 changes: 2 additions & 2 deletions candle-nn/src/var_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ impl SimpleBackend for candle::npy::NpzTensors {
}

fn contains_tensor(&self, name: &str) -> bool {
self.get(name).map_or(false, |v| v.is_some())
self.get(name).is_ok_and(|v| v.is_some())
}
}

Expand Down Expand Up @@ -383,7 +383,7 @@ impl SimpleBackend for candle::pickle::PthTensors {
}

fn contains_tensor(&self, name: &str) -> bool {
self.get(name).map_or(false, |v| v.is_some())
self.get(name).is_ok_and(|v| v.is_some())
}
}

Expand Down

0 comments on commit 2885125

Please sign in to comment.