Skip to content

Commit

Permalink
Silence warnings that only appear in some build configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
ebarnard committed Sep 17, 2022
1 parent 92561d6 commit ddff8e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ pub(crate) enum ErrorKind {
UnexpectedEof,
UnexpectedEndOfEventStream,
UnexpectedEventType {
#[allow(dead_code)]
expected: EventKind,
#[allow(dead_code)]
found: EventKind,
},

Expand Down Expand Up @@ -55,6 +57,7 @@ pub(crate) enum ErrorKind {
UnknownObjectType(u8),

Io(io::Error),
#[cfg(feature = "serde")]
Serde(String),
}

Expand Down
10 changes: 6 additions & 4 deletions src/stream/xml_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub struct XmlWriter<W: Write> {
}

impl<W: Write> XmlWriter<W> {
#[cfg(fearure = "enable_unstable_features_that_may_break_with_minor_version_bumps")]
pub fn new(writer: W) -> XmlWriter<W> {
let opts = XmlWriteOptions::default();
XmlWriter::new_with_options(writer, &opts)
Expand Down Expand Up @@ -62,6 +63,11 @@ impl<W: Write> XmlWriter<W> {
}
}

#[cfg(feature="enable_unstable_features_that_may_break_with_minor_version_bumps")]
pub fn into_inner(self) -> W {
self.xml_writer.into_inner()
}

fn write_element_and_value(&mut self, name: &str, value: &str) -> Result<(), Error> {
self.start_element(name)?;
self.write_value(value)?;
Expand Down Expand Up @@ -96,10 +102,6 @@ impl<W: Write> XmlWriter<W> {
Ok(())
}

pub fn into_inner(self) -> W {
self.xml_writer.into_inner()
}

fn write_event<F: FnOnce(&mut Self) -> Result<(), Error>>(
&mut self,
f: F,
Expand Down

0 comments on commit ddff8e6

Please sign in to comment.