Skip to content

Commit

Permalink
Fix new warnings from nightly Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
ebarnard committed Mar 23, 2024
1 parent d8abd76 commit eb75357
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Dictionary {
/// in the dictionary.
#[inline]
pub fn remove(&mut self, key: &str) -> Option<Value> {
self.map.remove(key)
self.map.swap_remove(key)
}

/// Scan through each key-value pair in the map and keep those where the
Expand Down Expand Up @@ -540,7 +540,7 @@ impl<'a> OccupiedEntry<'a> {
/// ```
#[inline]
pub fn remove(self) -> Value {
self.occupied.remove()
self.occupied.swap_remove()
}
}

Expand Down
10 changes: 8 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,17 @@ pub(crate) enum ErrorKind {
InfiniteOrNanDate,
InvalidUtf8String,
InvalidUtf16String,
UnknownObjectType(u8),
UnknownObjectType(
// Used by the `Debug` implementation.
#[allow(dead_code)] u8,
),

Io(io::Error),
#[cfg(feature = "serde")]
Serde(String),
Serde(
// Used by the `Debug` implementation.
#[allow(dead_code)] String,
),
}

#[derive(Debug, Clone, Copy)]
Expand Down

0 comments on commit eb75357

Please sign in to comment.