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 authored Mar 23, 2024
1 parent d8abd76 commit a2cde06
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use indexmap::{map, IndexMap};
use std::{
fmt::{self, Debug},
iter::FromIterator,
ops,
};

Expand Down Expand Up @@ -67,7 +66,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 +539,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
1 change: 0 additions & 1 deletion src/stream/binary_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ mod tests {
use std::fs::File;

use super::*;
use crate::{stream::Event, Uid};

#[test]
fn streaming_parser() {
Expand Down
2 changes: 1 addition & 1 deletion src/stream/xml_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ mod tests {
use std::fs::File;

use super::*;
use crate::stream::Event::{self, *};
use crate::stream::Event::*;

#[test]
fn streaming_parser() {
Expand Down
2 changes: 1 addition & 1 deletion src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ mod tests {
use std::time::SystemTime;

use super::*;
use crate::{stream::Event::*, Date, Dictionary, Value};
use crate::{stream::Event::*, Date};

#[test]
fn value_accessors() {
Expand Down

0 comments on commit a2cde06

Please sign in to comment.