Skip to content
Merged
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
11 changes: 5 additions & 6 deletions xml5ever/src/tokenizer/states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
//! This is public for use by the tokenizer tests. Other library
//! users should not have to care about this.

pub use self::AttrValueKind::*;
pub use self::DoctypeKind::*;
pub use self::XmlState::*;
#![allow(missing_docs)] // FIXME
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please open a bug for this and link to it here. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: #648. Thanks for the review (:


pub use AttrValueKind::*;
pub use DoctypeKind::*;
pub use XmlState::*;

#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Debug)]
#[doc(hidden)]
pub enum DoctypeKind {
Public,
System,
}

#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Debug)]
#[doc(hidden)]
pub enum XmlState {
Data,
TagState,
Expand Down Expand Up @@ -73,7 +73,6 @@ pub enum XmlState {
}

#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash, Debug)]
#[doc(hidden)]
pub enum AttrValueKind {
Unquoted,
SingleQuoted,
Expand Down
20 changes: 6 additions & 14 deletions xml5ever/src/tree_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ impl NamespaceMapStack {
self.0.push(map);
}

#[doc(hidden)]
pub fn pop(&mut self) {
fn pop(&mut self) {
self.0.pop();
}
}

#[doc(hidden)]
pub struct NamespaceMap {
pub(crate) struct NamespaceMap {
// Map that maps prefixes to URI.
//
// Key denotes namespace prefix, and value denotes
Expand All @@ -77,8 +75,7 @@ impl Debug for NamespaceMap {

impl NamespaceMap {
// Returns an empty namespace.
#[doc(hidden)]
pub fn empty() -> NamespaceMap {
pub(crate) fn empty() -> NamespaceMap {
NamespaceMap {
scope: BTreeMap::new(),
}
Expand All @@ -96,18 +93,15 @@ impl NamespaceMap {
}
}

#[doc(hidden)]
pub fn get(&self, prefix: &Option<Prefix>) -> Option<&Option<Namespace>> {
pub(crate) fn get(&self, prefix: &Option<Prefix>) -> Option<&Option<Namespace>> {
self.scope.get(prefix)
}

#[doc(hidden)]
pub fn get_scope_iter(&self) -> Iter<'_, Option<Prefix>, Option<Namespace>> {
pub(crate) fn get_scope_iter(&self) -> Iter<'_, Option<Prefix>, Option<Namespace>> {
self.scope.iter()
}

#[doc(hidden)]
pub fn insert(&mut self, name: &QualName) {
pub(crate) fn insert(&mut self, name: &QualName) {
let prefix = name.prefix.as_ref().cloned();
let namespace = Some(Namespace::from(&*name.ns));
self.scope.insert(prefix, namespace);
Expand Down Expand Up @@ -438,7 +432,6 @@ fn current_node<Handle>(open_elems: &[Handle]) -> &Handle {
open_elems.last().expect("no current element")
}

#[doc(hidden)]
impl<Handle, Sink> XmlTreeBuilder<Handle, Sink>
where
Handle: Clone,
Expand Down Expand Up @@ -607,7 +600,6 @@ fn any_not_whitespace(x: &StrTendril) -> bool {
.all(|b| matches!(b, b'\t' | b'\r' | b'\n' | b'\x0C' | b' '))
}

#[doc(hidden)]
impl<Handle, Sink> XmlTreeBuilder<Handle, Sink>
where
Handle: Clone,
Expand Down