Skip to content

Commit 29962e7

Browse files
authored
Merge pull request #732 from Mingun/fix-warnings
Fix warnings reported by new rustc
2 parents 88aa477 + ff5630c commit 29962e7

File tree

8 files changed

+8
-12
lines changed

8 files changed

+8
-12
lines changed

examples/read_nodes.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const XML: &str = r#"
3030
</Localization>
3131
"#;
3232

33+
// Enum variants is not read in example, so suppress the warning
34+
#[allow(dead_code)]
3335
#[derive(Debug)]
3436
enum AppError {
3537
/// XML parsing error

src/de/simple_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::utils::CowRef;
1111
use memchr::memchr;
1212
use serde::de::value::UnitDeserializer;
1313
use serde::de::{DeserializeSeed, Deserializer, EnumAccess, SeqAccess, VariantAccess, Visitor};
14-
use serde::{self, serde_if_integer128};
14+
use serde::serde_if_integer128;
1515
use std::borrow::Cow;
1616
use std::ops::Range;
1717

src/errors.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ pub mod serialize {
308308
//! A module to handle serde (de)serialization errors
309309
310310
use super::*;
311-
use crate::utils::write_byte_string;
312311
use std::borrow::Cow;
313312
#[cfg(feature = "overlapped-lists")]
314313
use std::num::NonZeroUsize;

src/name.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use crate::events::attributes::Attribute;
88
use crate::events::BytesStart;
99
use crate::utils::write_byte_string;
1010
use memchr::memchr;
11-
use std::convert::TryFrom;
1211
use std::fmt::{self, Debug, Formatter};
1312

1413
/// A [qualified name] of an element or an attribute, including an optional

src/reader/buffered_reader.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use std::fs::File;
55
use std::io::{self, BufRead, BufReader};
66
use std::path::Path;
77

8-
use memchr;
9-
108
use crate::errors::{Error, Result, SyntaxError};
119
use crate::events::Event;
1210
use crate::name::QName;
@@ -233,7 +231,11 @@ macro_rules! impl_buffered_source {
233231
};
234232
}
235233

236-
// Make it public for use in async implementations
234+
// Make it public for use in async implementations.
235+
// New rustc reports
236+
// > warning: the item `impl_buffered_source` is imported redundantly
237+
// so make it public only when async feature is enabled
238+
#[cfg(feature = "async-tokio")]
237239
pub(super) use impl_buffered_source;
238240

239241
/// Implementation of `XmlSource` for any `BufRead` reader using a user-given

src/reader/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ use crate::errors::{Error, Result, SyntaxError};
99
use crate::events::Event;
1010
use crate::reader::state::ReaderState;
1111

12-
use memchr;
13-
1412
/// A struct that holds a parser configuration.
1513
///
1614
/// Current parser configuration can be retrieved by calling [`Reader::config()`]

src/reader/slice_reader.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ use crate::events::Event;
1414
use crate::name::QName;
1515
use crate::reader::{is_whitespace, BangType, ReadElementState, Reader, Span, XmlSource};
1616

17-
use memchr;
18-
1917
/// This is an implementation for reading from a `&[u8]` as underlying byte stream.
2018
/// This implementation supports not using an intermediate buffer as the byte slice
2119
/// itself can be used to borrow from.

src/reader/state.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ use crate::events::{BytesCData, BytesDecl, BytesEnd, BytesStart, BytesText, Even
88
use crate::reader::EncodingRef;
99
use crate::reader::{is_whitespace, BangType, Config, ParseState};
1010

11-
use memchr;
12-
1311
/// A struct that holds a current reader state and a parser configuration.
1412
/// It is independent on a way of reading data: the reader feed data into it and
1513
/// get back produced [`Event`]s.

0 commit comments

Comments
 (0)