Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "quick-xml"
version = "0.22.0"
authors = ["Johann Tuffe <tafia973@gmail.com>"]
description = "High performance xml reader and writer"
edition = "2021"

documentation = "https://docs.rs/quick-xml"
repository = "https://github.com/tafia/quick-xml"
Expand Down
2 changes: 1 addition & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub enum Error {
/// Duplicate attribute
DuplicatedAttribute(usize, usize),
/// Escape error
EscapeError(::escape::EscapeError),
EscapeError(crate::escape::EscapeError),
}

impl From<::std::io::Error> for Error {
Expand Down
14 changes: 7 additions & 7 deletions src/events/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
//!
//! Provides an iterator over attributes key/value pairs

use errors::{Error, Result};
use escape::{do_unescape, escape};
use reader::{is_whitespace, Reader};
use crate::errors::{Error, Result};
use crate::escape::{do_unescape, escape};
use crate::reader::{is_whitespace, Reader};
use std::borrow::Cow;
use std::collections::HashMap;
use std::io::BufRead;
Expand Down Expand Up @@ -359,7 +359,7 @@ impl<'a> Iterator for Attributes<'a> {
return Some(Ok(Attribute {
key: &self.bytes[$key],
value: Cow::Borrowed(&self.bytes[$val]),
}));
}))
};
}

Expand Down Expand Up @@ -426,10 +426,10 @@ impl<'a> Iterator for Attributes<'a> {
match bytes.by_ref().find(|&(_, &b)| b == *quote) {
Some((j, _)) => {
self.position = j + 1;
attr!(start_key..end_key, i + 1..j)
attr!(start_key..end_key, i + 1..j);
}
None => err!(Error::UnquotedValue(i)),
}
};
}
Some((i, _)) if self.html => {
let j = bytes
Expand All @@ -441,7 +441,7 @@ impl<'a> Iterator for Attributes<'a> {
}
Some((i, _)) => err!(Error::UnquotedValue(i)),
None => attr!(start_key..end_key),
}
};
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ use std::ops::Deref;
use std::str::from_utf8;

use self::attributes::{Attribute, Attributes};
use errors::{Error, Result};
use escape::{do_unescape, escape};
use reader::Reader;
use crate::errors::{Error, Result};
use crate::escape::{do_unescape, escape};
use crate::reader::Reader;

use memchr;

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ mod errors;
mod escapei;
pub mod escape {
//! Manage xml character escapes
pub(crate) use escapei::{do_unescape, EscapeError};
pub use escapei::{escape, unescape, unescape_with};
pub(crate) use crate::escapei::{do_unescape, EscapeError};
pub(crate) use crate::escapei::{escape, unescape, unescape_with};
}
pub mod events;
mod reader;
Expand Down
4 changes: 2 additions & 2 deletions src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use std::str::from_utf8;
#[cfg(feature = "encoding")]
use encoding_rs::{Encoding, UTF_16BE, UTF_16LE};

use errors::{Error, Result};
use events::{attributes::Attribute, BytesDecl, BytesEnd, BytesStart, BytesText, Event};
use crate::errors::{Error, Result};
use crate::events::{attributes::Attribute, BytesDecl, BytesEnd, BytesStart, BytesText, Event};

use memchr;

Expand Down
6 changes: 3 additions & 3 deletions src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

use std::io::Write;

use errors::{Error, Result};
use events::Event;
use crate::errors::{Error, Result};
use crate::events::Event;

/// XML writer.
///
Expand Down Expand Up @@ -210,7 +210,7 @@ impl Indentation {
#[cfg(test)]
mod indentation {
use super::*;
use events::*;
use crate::events::*;

#[test]
fn self_closed() {
Expand Down