Skip to content

Commit

Permalink
Get rid warning when compile without "serialize" feature
Browse files Browse the repository at this point in the history
Introduced in #571
  • Loading branch information
Mingun committed Mar 13, 2023
1 parent 42e2350 commit fe9b040
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ use crate::errors::{Error, Result};
use crate::escape::{escape, partial_escape, unescape_with};
use crate::name::{LocalName, QName};
use crate::reader::is_whitespace;
use crate::utils::{write_cow_string, CowRef};
use crate::utils::write_cow_string;
#[cfg(feature = "serialize")]
use crate::utils::CowRef;
use attributes::{Attribute, Attributes};
use std::mem::replace;

Expand Down Expand Up @@ -198,6 +200,7 @@ impl<'a> BytesStart<'a> {
/// - `'a`: Lifetime of the input data from which this event is borrow
/// - `'e`: Lifetime of the concrete event instance
// TODO: We should made this is a part of public API, but with safe wrapped for a name
#[cfg(feature = "serialize")]
pub(crate) fn raw_name<'e>(&'e self) -> CowRef<'a, 'e, [u8]> {
match self.buf {
Cow::Borrowed(b) => CowRef::Input(&b[..self.name_len]),
Expand Down

0 comments on commit fe9b040

Please sign in to comment.