Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Oct 26, 2024
1 parent 8f3a727 commit af17fc2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ impl UsbDevice {

pub(crate) fn new_string(&mut self, s: &str) -> u8 {
for i in 1.. {
if self.string_pool.get(&i).is_none() {
self.string_pool.insert(i, s.to_string());
if let std::collections::hash_map::Entry::Vacant(e) = self.string_pool.entry(i) {
e.insert(s.to_string());
return i;
}
}
Expand Down

0 comments on commit af17fc2

Please sign in to comment.