commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
faffff8e97ab06a9a62d46ad26ac334a039e5514 | Adam Reichold | 2025-01-14T20:57:02 | Use of try_consume_reference always treats failure as fatal, so no need to backtrack. | diff --git a/src/parse.rs b/src/parse.rs
index 29c61e6..59751d7 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -1082,7 +1082,7 @@ fn parse_next_chunk<'a>(stream: &mut Stream<'a>, entities: &[Entity<'a>]) -> Res
// Check for character/entity references.
if c == b'&' {
let start = stream.pos();
- ... | 2 | 3 | 16 |
bc7a8163bfa2a1b7f5bdb7c3b90ccea21e3c296d | Adam Reichold | 2025-01-12T11:08:47 | Devirtualize XmlEvents dispatch to give the optimizer full visibility
As XmlEvents is not public API any more, there should be no possibility
of code bloat due to multiple instantiations and we can safely monomorphise
dispatch from the tokenizer into the parser. | diff --git a/src/parse.rs b/src/parse.rs
index 03cd58f..29c61e6 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -609,6 +609,7 @@ fn parse(text: &str, opt: ParsingOptions) -> Result<Document> {
}
impl<'input> tokenizer::XmlEvents<'input> for Context<'input> {
+ #[inline(always)]
fn token(&mut self, token: to... | 2 | 12 | 11 |
23b4dee8faa36c64b4cafffe1ecd7b2bef82c2e2 | Adam Reichold | 2025-01-12T10:52:47 | Add ASCII-only fast path also for checking NameStartChar in qualified names. | diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index 4b9ddd4..daf15dc 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -25,7 +25,7 @@ impl XmlCharExt for char {
fn is_xml_name_start(&self) -> bool {
// Check for ASCII first.
if *self as u32 <= 128 {
- return matches!(*self as ... | 1 | 26 | 12 |
3a35f382092d9ce507d5d4fe6d98b0dbf7191208 | Adam Reichold | 2025-01-13T19:04:12 | Fix post-merge SNAFU of referencing now-dissolved err_pos_at. | diff --git a/src/parse.rs b/src/parse.rs
index 620578b..e62175e 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -820,7 +820,7 @@ fn process_element<'input>(
// <p>&p;&p;
return Err(Error::UnexpectedEntityCloseTag(
- ctx.err_pos_at(token_range.start),
+ ... | 1 | 1 | 1 |
57d754cbba62cf8b1156a2d57008ebc10c9d1480 | Adam Reichold | 2025-01-12T20:03:32 | Dissolve err_pos_at so that get_ns_idx_by_prefix does not need to borrow the whole context. | diff --git a/src/parse.rs b/src/parse.rs
index b140c76..3dc012e 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -547,10 +547,6 @@ impl<'input> Context<'input> {
Ok(new_child_id)
}
-
- fn err_pos_at(&self, pos: usize) -> TextPos {
- self.doc.text_pos_at(pos)
- }
}
fn parse(text: &str, op... | 1 | 18 | 24 |
dffe411f30752e1b4312a6a9b782225dac9d86c5 | Adam Reichold | 2025-01-12T13:48:03 | Do not drop the allocation backing current_attributes. | diff --git a/src/parse.rs b/src/parse.rs
index f95baf7..b140c76 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -886,8 +886,8 @@ fn resolve_attributes(namespaces: ShortRange, ctx: &mut Context) -> Result<Short
let start_idx = ctx.doc.attributes.len();
- let current_attributes = core::mem::take(&mut ctx.curr... | 1 | 3 | 2 |
1a68ff463d8a3e2205d53e2fd7bcb2309c62b1ba | Adam Reichold | 2025-01-08T20:15:24 | Drop sorted_order after parsing as it is not used anymore
After parsing, nothing in the public API actually accesses `sorted_order`
which is only used to deduplicate namespaces encountered during the parsing
process. Hence, we can free the memory immediately after parsing. | diff --git a/src/lib.rs b/src/lib.rs
index 7e3e00f..3906288 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -756,7 +756,8 @@ impl<'input> Namespaces<'input> {
fn shrink_to_fit(&mut self) {
self.values.shrink_to_fit();
self.tree_order.shrink_to_fit();
- self.sorted_order.shrink_to_fit();
+ ... | 1 | 2 | 1 |
18adb7cc593c505620198c3b1561e1ec0395c518 | Adam Reichold | 2025-01-11T19:44:13 | Avoid materializing qname_len and eq_len on the heap without positions feature | diff --git a/src/parse.rs b/src/parse.rs
index a7e0154..f95baf7 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -351,9 +351,9 @@ struct TempAttributeData<'input> {
local: &'input str,
value: StringStorage<'input>,
range: Range<usize>,
- #[allow(unused)] // only used for feature "positions"
+ #[cfg(... | 1 | 7 | 2 |
a8cc9ae58bbde80c47907ed51cc51bc4bbb2ab85 | Adam Reichold | 2025-01-11T19:11:07 | Make current nightly Clippy happy | diff --git a/src/lib.rs b/src/lib.rs
index 71a00a6..7e3e00f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -332,8 +332,8 @@ struct ShortRange {
impl From<Range<usize>> for ShortRange {
#[inline]
fn from(range: Range<usize>) -> Self {
- debug_assert!(range.start <= core::u32::MAX as usize);
- debug... | 3 | 13 | 21 |
dfed9be9e0eae22921ec7156fde2cca9dbd98195 | Jayonas | 2024-05-23T08:42:07 | Add `range_qname` and `range_value` methods to `Attribute`. | diff --git a/Cargo.toml b/Cargo.toml
index 6ca4850..c66c681 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,5 +20,6 @@ exclude = ["testing-tools"]
default = ["std", "positions"]
std = []
# Enables Nodes and Attributes position in the original document preserving.
-# Increases memory usage by `Range<usize>` for each ... | 6 | 125 | 6 |
6e7293b93159e75a5bcb02fe7405d8df47b1f4ba | Jayonas | 2024-05-22T08:44:35 | Add `Attribute.range()` method.
Closes #113 | diff --git a/Cargo.toml b/Cargo.toml
index d1cfd9f..6ca4850 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,5 +20,5 @@ exclude = ["testing-tools"]
default = ["std", "positions"]
std = []
# Enables Nodes and Attributes position in the original document preserving.
-# Increases memory usage by `usize` for each Node an... | 5 | 37 | 21 |
7e739cb9ee1c553e3b94b524b3242acdb445d79d | Yevhenii Reizner | 2023-11-18T10:34:38 | A nicer unexpected XML declaration error. | diff --git a/src/parse.rs b/src/parse.rs
index 50332fd..42d51a7 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -84,6 +84,10 @@ pub enum Error {
/// The root node was opened but never closed.
UnclosedRootNode,
+ /// An XML document can have only one XML declaration
+ /// and it must be at the start of... | 3 | 21 | 15 |
8d7c362a65998bd56face33c8d172aa7a5718e04 | Yevhenii Reizner | 2023-11-18T10:18:59 | Rename lifetimes. | diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index a1b5f0f..98f53ef 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -108,19 +108,19 @@ impl XmlByteExt for u8 {
/// from which it was parsed.
#[must_use]
#[derive(Clone, Copy)]
-pub struct StrSpan<'a> {
- text: &'a str,
+pub struct StrSpan<'input> {
+ ... | 1 | 64 | 48 |
ce1d004094da7dbf2f21d4aaaa7f1a79d5ead2b4 | Yevhenii Reizner | 2023-11-15T09:20:47 | Fix build without default features. | diff --git a/src/parse.rs b/src/parse.rs
index d229a0f..2c83822 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -345,7 +345,6 @@ struct TempAttributeData<'input> {
prefix: &'input str,
local: &'input str,
value: StringStorage<'input>,
- #[cfg(feature = "positions")]
pos: usize,
}
@@ -725,7 +72... | 1 | 0 | 2 |
30b8c81ca458a945d958ce4fdd5d1e1073831ebf | Yevhenii Reizner | 2023-11-14T18:49:33 | Simplify parser a bit. | diff --git a/src/parse.rs b/src/parse.rs
index 0625823..e40f5ba 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -9,6 +9,8 @@ use crate::{
NodeKind, ShortRange, StringStorage, NS_XMLNS_URI, NS_XML_PREFIX, NS_XML_URI, PI, XMLNS,
};
+type Result<T> = core::result::Result<T, Error>;
+
/// A list of all possible er... | 1 | 222 | 263 |
0e2e247d5a46a8e068dd7539bc4370d88068730b | Yevhenii Reizner | 2023-09-30T17:00:27 | Simple refactoring. | diff --git a/src/lib.rs b/src/lib.rs
index dc422b1..4fb9aff 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -30,6 +30,7 @@ use core::cmp::Ordering;
use core::fmt;
use core::hash::{Hash, Hasher};
use core::num::NonZeroU32;
+use core::ops::Range;
use alloc::vec::Vec;
@@ -48,8 +49,6 @@ pub const NS_XMLNS_URI: &str = "... | 2 | 89 | 83 |
1165904d8065ad6d7baa1624aa6a099b34e390c2 | Yevhenii Reizner | 2023-09-30T16:45:18 | Remove needless inlines. | diff --git a/src/parse.rs b/src/parse.rs
index f6a6440..4d71a1f 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -102,7 +102,6 @@ pub enum Error {
impl Error {
/// Returns the error position.
- #[inline]
pub fn pos(&self) -> TextPos {
match *self {
Error::InvalidXmlPrefixUri(pos) =>... | 1 | 0 | 6 |
95f84c657a8356f2f761aa34927308e977b59955 | Yevhenii Reizner | 2023-09-30T16:35:17 | Simple refactoring. | diff --git a/src/parse.rs b/src/parse.rs
index 9f74e4b..f6a6440 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -311,9 +311,9 @@ impl<'input> Document<'input> {
&mut self,
kind: NodeKind<'input>,
range: core::ops::Range<usize>,
- pd: &mut ParserData<'input>,
+ state: &mut Parser... | 1 | 75 | 63 |
9d98b37cf103c12c48581355d88289e601c70a17 | Yevhenii Reizner | 2023-09-30T16:33:35 | Simplify code a bit. v2 | diff --git a/src/parse.rs b/src/parse.rs
index 0c16eb7..9f74e4b 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -309,7 +309,6 @@ impl<'input> Document<'input> {
fn append(
&mut self,
- parent_id: NodeId,
kind: NodeKind<'input>,
range: core::ops::Range<usize>,
pd: &mut P... | 1 | 18 | 50 |
71c1b732fb349750b87a6a594cd529cf4b256f48 | Yevhenii Reizner | 2023-09-30T16:27:07 | Simplify code a bit. | diff --git a/src/parse.rs b/src/parse.rs
index 1823e2b..0c16eb7 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -312,10 +312,9 @@ impl<'input> Document<'input> {
parent_id: NodeId,
kind: NodeKind<'input>,
range: core::ops::Range<usize>,
- nodes_limit: u32,
- awaiting_subtree: &m... | 1 | 64 | 72 |
978266affbaad7a1f295ac6db154aaa98def2472 | Wenyu Zhao | 2023-09-17T10:36:19 | Fix xmlparser features for no_std build. | diff --git a/Cargo.toml b/Cargo.toml
index 58b4b3e..18f0252 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,11 +16,11 @@ members = ["benches"]
exclude = ["test-apps", "testing-tools"]
[dependencies]
-xmlparser = "0.13.5"
+xmlparser = { version = "0.13.5", default-features = false }
[features]
default = ["std", ... | 1 | 2 | 2 |
adec50c7361cf1dfbbea03bc928d1d20728f230d | Adam Reichold | 2023-06-29T18:53:16 | Avoid redundant tuple layer for ExpandedName::from_static. | diff --git a/src/lib.rs b/src/lib.rs
index 28225ee..dc422b1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -755,12 +755,12 @@ impl ExpandedName<'static, 'static> {
/// ```rust
/// use roxmltree::ExpandedName;
/// const DAV_HREF: ExpandedName =
- /// ExpandedName::from_static(("urn:ietf:params:xml:ns:... | 3 | 10 | 7 |
c5fd5e1203b21b938b613d91ab94c16236a01a23 | Hugo | 2023-06-29T16:48:40 | Add a const constructor for ExpandedName. | diff --git a/src/lib.rs b/src/lib.rs
index 3431a86..28225ee 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -747,6 +747,24 @@ impl<'a, 'b> ExpandedName<'a, 'b> {
}
}
+impl ExpandedName<'static, 'static> {
+ /// Create a new instance from static data.
+ ///
+ /// # Example
+ ///
+ /// ```rust
+ ///... | 1 | 18 | 0 |
e81718610aa8943664c937844f60dda34bce4556 | Adam Reichold | 2023-01-23T08:32:20 | Expose 'input lifetime where it is the backing lifetime. | diff --git a/src/lib.rs b/src/lib.rs
index 061108d..bb845b1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -450,7 +450,7 @@ impl<'a, 'input> Attribute<'a, 'input> {
/// assert_eq!(doc.root_element().attributes().nth(1).unwrap().name(), "a");
/// ```
#[inline]
- pub fn name(&self) -> &'a str {
+ pub fn... | 1 | 4 | 4 |
0b12673528ce049e94d080156e139b59a51dbc05 | Adam Reichold | 2023-01-16T01:53:25 | Use consistent debug impls for the various iterators that avoid formatting the whole document.
Closes #87 | diff --git a/src/lib.rs b/src/lib.rs
index 6da167b..061108d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -380,6 +380,7 @@ impl From<usize> for NodeId {
}
}
+#[derive(Debug)]
enum NodeKind<'input> {
Root,
Element {
@@ -392,6 +393,7 @@ enum NodeKind<'input> {
Text(Cow<'input, str>),
}
+#[derive(... | 1 | 21 | 7 |
3a490a5a577d996582f7eefbe385805cd0982562 | Adam Reichold | 2022-11-21T16:10:49 | Provide a named type for the iterator returned by Node::namespaces and expand on the capabilities of the Descendants iterator. | diff --git a/src/lib.rs b/src/lib.rs
index a13f986..c521143 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1030,19 +1030,18 @@ impl<'a, 'input: 'a> Node<'a, 'input> {
/// assert_eq!(doc.root_element().namespaces().len(), 1);
/// ```
#[inline]
- pub fn namespaces(&self) -> impl ExactSizeIterator<Item = &... | 1 | 106 | 22 |
192d45edee22e928a2d8bfc29ae3ce54536411d8 | Adam Reichold | 2022-11-21T15:35:39 | Only allocate normalized namespace URI when they are uniquely new. | diff --git a/src/lib.rs b/src/lib.rs
index 862aacb..a13f986 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -508,7 +508,7 @@ impl fmt::Debug for Attribute<'_, '_> {
/// A namespace.
///
/// Contains URI and *prefix* pair.
-#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
+#[derive(Clone, PartialEq, Eq, Debug)]
p... | 2 | 23 | 18 |
3809cd4f05663dc4420cdf8251f07d023913d115 | Adam Reichold | 2022-11-21T15:31:21 | Enable code to delay taking ownership of normalized values. | diff --git a/src/parse.rs b/src/parse.rs
index d295797..541eba6 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -654,12 +654,12 @@ fn process_attribute<'input>(
if prefix.as_str() == XMLNS {
// The xmlns namespace MUST NOT be declared as the default namespace.
- if value == NS_XMLNS_URI {
+ ... | 1 | 31 | 20 |
0de61b63fd6b1c5ad9f3250a834c0d93847bfbc9 | Adam Reichold | 2022-11-21T10:02:16 | Actually ensure that the number of unique namespaces fits into the smaller type. | diff --git a/src/lib.rs b/src/lib.rs
index 362af0d..862aacb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -568,28 +568,29 @@ struct Namespaces<'input> {
impl<'input> Namespaces<'input> {
#[inline]
- fn push_ns(&mut self, name: Option<&'input str>, uri: Cow<'input, str>) {
+ fn push_ns(&mut self, name: Optio... | 2 | 28 | 15 |
81a8ee62a298cae9293046e923d1cb2194dbf801 | Adam Reichold | 2022-11-21T09:58:33 | Use a smaller data type to index namespaces. | diff --git a/src/lib.rs b/src/lib.rs
index 3659347..362af0d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -561,9 +561,9 @@ struct Namespaces<'input> {
// Deduplicated namespace values used throughout the document
values: Vec<Namespace<'input>>,
// Indices into the above in tree order as the document is par... | 2 | 13 | 11 |
9c86ba16c6fe3b8afc22aafc609698cb1cdc6bf6 | Adam Reichold | 2022-11-21T09:47:08 | Make ExpandedNameIndexed::namespace_idx index directly into Namespaces::value to avoid unnecessary indirection. | diff --git a/src/lib.rs b/src/lib.rs
index 132861c..3659347 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -614,7 +614,7 @@ impl<'input> Namespaces<'input> {
#[derive(Clone, Copy, Debug)]
struct ExpandedNameIndexed<'input> {
- /// Indexes into `Namspaces::tree`
+ /// Indexes into `Namspaces::values`
namespa... | 2 | 4 | 5 |
a86683c361791c5ccfb1f744c22ffdd17e1a078a | Adam Reichold | 2022-11-21T09:42:31 | Deduplicate namespace values using separate sorted-order and tree-order lists. | diff --git a/src/lib.rs b/src/lib.rs
index aee995c..132861c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -32,7 +32,6 @@ use core::cmp::Ordering;
use core::fmt;
use core::hash::{Hash, Hasher};
use core::num::NonZeroU32;
-use core::ops::Deref;
pub use xmlparser::TextPos;
@@ -509,7 +508,7 @@ impl fmt::Debug for Att... | 3 | 73 | 35 |
e68952a9c3ae39c6c143b5a91ae1f373e71330d3 | Adam Reichold | 2022-11-21T11:07:46 | Make impl PartialEq and Ord for Node simpler and consistent | diff --git a/src/lib.rs b/src/lib.rs
index e0aa462..aee995c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -707,9 +707,7 @@ impl Eq for Node<'_, '_> {}
impl PartialEq for Node<'_, '_> {
#[inline]
fn eq(&self, other: &Self) -> bool {
- self.id == other.id
- && core::ptr::eq(self.doc as *const _... | 1 | 2 | 12 |
e666e686240b0b2d1606f92c8965e233359651ef | Adam Reichold | 2022-11-21T11:07:24 | Fix impl PartialEq for Attribute | diff --git a/src/lib.rs b/src/lib.rs
index bab5182..e0aa462 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -490,7 +490,7 @@ impl<'a, 'input> Attribute<'a, 'input> {
impl PartialEq for Attribute<'_, '_> {
#[inline]
fn eq(&self, other: &Attribute<'_, '_>) -> bool {
- self.data.name.as_expanded_name(self.do... | 1 | 1 | 1 |
e5fa00eae4b5e121ed82b0d640d602dd4300563e | Adam Reichold | 2022-11-21T07:27:33 | Drop attrs_start_idx and use drain when resolving attributes. | diff --git a/src/lib.rs b/src/lib.rs
index eb75da3..bab5182 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -355,7 +355,7 @@ impl NodeId {
/// Returns the `u32` representation of the `NodeId`.
#[inline]
pub fn get(self) -> u32 {
- self.0.get() as u32 - 1
+ self.0.get() - 1
}
/// Ret... | 2 | 6 | 10 |
6a2915b5a2e30d650dc5a28ccb09d319a9dad9f7 | Yevhenii Reizner | 2022-11-20T21:13:19 | Make sure we allocate less than u32::MAX attributes. | diff --git a/src/parse.rs b/src/parse.rs
index 1545ea8..8191631 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -831,6 +831,10 @@ fn resolve_attributes<'input>(
return Ok(ShortRange::new(0, 0));
}
+ if doc.attrs.len() + pd.tmp_attrs.len() >= core::u32::MAX as usize {
+ return Err(Error::NodesL... | 1 | 4 | 0 |
b13557b2351032a01b3160ff7f1d2ef178808b6d | Yevhenii Reizner | 2022-11-20T20:00:38 | Fix clippy warnings. | diff --git a/src/lib.rs b/src/lib.rs
index 39fd4b1..e3fb7f4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -274,7 +274,7 @@ impl<'input> fmt::Debug for Document<'input> {
}
/// A list of supported node types.
-#[derive(Clone, Copy, PartialEq, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum NodeType {
... | 2 | 5 | 5 |
9a4308e809d9cb61d586bdf7f118cc6271fc8629 | Adam Reichold | 2022-11-17T14:39:40 | Use indexes for Node and Attribute Namespaces. | diff --git a/src/lib.rs b/src/lib.rs
index 908f76c..fd0024f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -28,7 +28,6 @@ extern crate alloc;
extern crate std;
use alloc::borrow::Cow;
-use alloc::boxed::Box;
use alloc::vec::Vec;
use core::cmp::Ordering;
use core::fmt;
@@ -83,7 +82,7 @@ pub struct Document<'input> {... | 3 | 166 | 150 |
7bb084a13184f87255a0a8f943fdb2c8e6219e00 | Adam Reichold | 2022-11-17T08:18:24 | Use named constant for XML-namespace-related prefixes. | diff --git a/src/lib.rs b/src/lib.rs
index 1462be8..908f76c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -44,9 +44,13 @@ pub use crate::parse::*;
/// The <http://www.w3.org/XML/1998/namespace> URI.
pub const NS_XML_URI: &str = "http://www.w3.org/XML/1998/namespace";
+/// The prefix 'xml', which is by definition boun... | 2 | 12 | 6 |
badb39101ec3b32f61d521a5c76f6f3ab5ce20dd | Adam Reichold | 2022-11-08T04:29:36 | Avoid temporary allocations when merging text nodes. | diff --git a/src/parse.rs b/src/parse.rs
index 7d3508c..c4bf5f2 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -1,4 +1,4 @@
-use alloc::borrow::{Cow, Borrow, ToOwned};
+use alloc::borrow::{Cow, ToOwned};
use alloc::string::{String, ToString};
use alloc::vec::Vec;
@@ -284,7 +284,7 @@ impl<'input> Document<'input> {... | 1 | 39 | 25 |
2ae4e3600df73e93f8db41d81af4b2ff50852d4a | Adam Reichold | 2022-11-01T19:18:49 | Use a custom version of Cow<'a, str> to reduce the size of ExpandedNameOwned. | diff --git a/src/lib.rs b/src/lib.rs
index e69861b..1462be8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -28,6 +28,7 @@ extern crate alloc;
extern crate std;
use alloc::borrow::Cow;
+use alloc::boxed::Box;
use alloc::vec::Vec;
use core::cmp::Ordering;
use core::fmt;
@@ -311,6 +312,52 @@ impl ShortRange {
}
... | 2 | 54 | 6 |
7fd2dc5888ea617bef803abea3638c956470680f | Adam Reichold | 2022-10-27T20:16:25 | Track parent prefixes using a stack to drop ExpandedNameOwned::prefix.
Part of #63 | diff --git a/src/lib.rs b/src/lib.rs
index 71d7b6e..a7bde5e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -575,7 +575,6 @@ impl<'input> Deref for Namespaces<'input> {
#[derive(Clone, PartialEq)]
struct ExpandedNameOwned<'input> {
ns: Option<Cow<'input, str>>,
- prefix: &'input str, // Used only for closing tags... | 2 | 17 | 11 |
2d2f5f12c6292ebb951b0e0e3eb0c5fd9e75f06c | Yevhenii Reizner | 2022-10-18T14:24:04 | Enable DTD in all examples. | diff --git a/examples/ast.rs b/examples/ast.rs
index 6201770..6979251 100644
--- a/examples/ast.rs
+++ b/examples/ast.rs
@@ -8,11 +8,7 @@ fn main() {
let text = std::fs::read_to_string(&args[1]).unwrap();
- // Allow DTD for this example.
- let opt = roxmltree::ParsingOptions {
- allow_dtd: true,
-... | 3 | 5 | 7 |
8072a8b1c6f3a98f480845b5640e332cc16360d1 | Yevhenii Reizner | 2022-08-15T16:52:10 | Fix no_std build. | diff --git a/src/lib.rs b/src/lib.rs
index 681dc23..71d7b6e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -709,8 +709,8 @@ impl PartialEq for Node<'_, '_> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.id == other.id
- && std::ptr::eq(self.doc as *const _, other.doc as *const _)
- ... | 1 | 2 | 2 |
c1183101f471a565d0612298bfa9c8b3409c7abd | Yevhenii Reizner | 2022-08-15T16:43:41 | Remove pretty_assertions dev-dependency. | diff --git a/Cargo.toml b/Cargo.toml
index 167d6c5..6459932 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,9 +18,6 @@ exclude = ["test-apps", "testing-tools"]
[dependencies]
xmlparser = "0.13.3"
-[dev-dependencies]
-pretty_assertions = "0.5"
-
[features]
default = ["std"]
std = []
diff --git a/tests/api.rs b/te... | 3 | 0 | 5 |
c49f9097b06ccde296d01ce188219cc1f61da02d | Yevhenii Reizner | 2022-08-15T16:41:41 | Clippy fixes. | diff --git a/src/lib.rs b/src/lib.rs
index da44fdc..e422e6e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -21,6 +21,9 @@ License: ISC.
#![warn(missing_copy_implementations)]
#![warn(missing_debug_implementations)]
+// `matches!` available since 1.42, but we target 1.36 for now.
+#![allow(clippy::match_like_matches_ma... | 2 | 9 | 3 |
c464ed8c96f02ca85c380ef5ed254e28b93d2239 | Adam Reichold | 2022-08-10T12:06:11 | Derive Eq and Hash for NodeId.
So that NodeId can be used as the key in a hash table. | diff --git a/src/lib.rs b/src/lib.rs
index cc94675..da44fdc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -319,7 +319,7 @@ impl ShortRange {
/// check that `NodeId` actually belongs to a selected `Document`.
/// So you can end up in a situation, when `NodeId` produced by one `Document`
/// is used to select a node in ... | 1 | 1 | 1 |
6e6dc3f22df3768b5a8d3c67f677891c29bd871c | Bastien Dejean | 2021-07-21T21:27:48 | Fix a few Clippy warnings | diff --git a/src/parse.rs b/src/parse.rs
index 4280503..2b392ae 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -652,14 +652,14 @@ fn process_element<'input>(
let namespaces = resolve_namespaces(pd.ns_start_idx, *parent_id, doc);
pd.ns_start_idx = doc.namespaces.len();
- let attributes = resolve_attribut... | 1 | 7 | 7 |
0b1915d120e90b751ed65428b68bb408522434b0 | Evgeniy Reizner | 2021-06-26T13:47:17 | Simplify testing. | diff --git a/Cargo.toml b/Cargo.toml
index e905c2f..167d6c5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,9 +15,6 @@ edition = "2018"
members = ["benches"]
exclude = ["test-apps", "testing-tools"]
-[badges]
-travis-ci = { repository = "RazrFalcon/roxmltree" }
-
[dependencies]
xmlparser = "0.13.3"
diff --git a... | 2 | 97 | 27 |
1e3295088dff7e5ce05d7538dc61eab10fcb051e | madjack | 2021-05-20T15:56:28 | Fix returned lifetime of Document::descendants(). | diff --git a/src/lib.rs b/src/lib.rs
index 3e05cf8..863c2de 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -142,7 +142,7 @@ impl<'input> Document<'input> {
///
/// Shorthand for `doc.root().descendants()`.
#[inline]
- pub fn descendants(&self) -> Descendants {
+ pub fn descendants(&self) -> Descendant... | 1 | 1 | 1 |
46fc688939e6f7bc21e211331d9f1c17f8314c1e | Evgeniy Reizner | 2021-04-01T10:02:12 | Enable the std feature by default. | diff --git a/Cargo.toml b/Cargo.toml
index e490eaf..f114f93 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,4 +25,5 @@ xmlparser = "0.13.3"
pretty_assertions = "0.5"
[features]
+default = ["std"]
std = [] | 1 | 1 | 0 |
07ae0f5bb35bc92801f02c6c2a0c515b227e3d6a | Evgeniy Reizner | 2020-12-19T21:57:56 | Add Debug for all public types.
Closes #39 | diff --git a/src/lib.rs b/src/lib.rs
index 4f90578..3cf5c98 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -17,6 +17,8 @@ License: ISC.
#![forbid(unsafe_code)]
#![warn(missing_docs)]
+#![warn(missing_copy_implementations)]
+#![warn(missing_debug_implementations)]
extern crate xmlparser;
@@ -1248,9 +1250,18 @@ imp... | 1 | 13 | 2 |
58679565fad3bbe576268c37a09ff4a00632bf5b | Eduardo Sánchez Muñoz | 2020-06-20T17:27:30 | Fix lifetimes when using ExpandedName as parameter. | diff --git a/src/lib.rs b/src/lib.rs
index 8e693d0..7975c4b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -595,12 +595,12 @@ impl<'input> fmt::Debug for ExpandedNameOwned<'input> {
///
/// Contains an namespace URI and name pair.
#[derive(Clone, Copy, PartialEq)]
-pub struct ExpandedName<'a, 'input> {
+pub struct Expa... | 1 | 17 | 17 |
ab2413503c47af7e3335bff7ac6b425d026b31eb | J. Frimmel | 2020-06-20T17:27:02 | Make `roxmltree::Error` compare-able (#32) | diff --git a/src/parse.rs b/src/parse.rs
index 6c18504..ca2a3b8 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -28,7 +28,7 @@ use crate::{
/// A list of all possible errors.
-#[derive(Debug)]
+#[derive(Clone, PartialEq, Eq, Hash, Debug)]
pub enum Error {
/// The `xmlns:xml` attribute must have an <http://ww... | 1 | 1 | 1 |
1ae0c6a6f5a40b3cbb0eb74e3551f786ad42fa83 | Markus Ast | 2020-06-19T17:16:43 | Fix lifetime of name in ExpandedName | diff --git a/src/lib.rs b/src/lib.rs
index 471449b..0665fed 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -571,9 +571,9 @@ struct ExpandedNameOwned<'input> {
name: &'input str,
}
-impl<'input> ExpandedNameOwned<'input> {
+impl<'a, 'input> ExpandedNameOwned<'input> {
#[inline]
- fn as_ref(&self) -> Expande... | 2 | 27 | 15 |
471083e6f86bdcf921951c35153c8a96d038ceab | Thomas Williamson | 2020-04-18T20:27:44 | Reduce duplication in Namespaces
Closes #25 | diff --git a/src/parse.rs b/src/parse.rs
index 3ace130..f8f24aa 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -645,32 +645,19 @@ fn resolve_namespaces(
parent_id: NodeId,
doc: &mut Document,
) -> Range {
- let mut tmp_parent_id = parent_id.get();
- while tmp_parent_id != 0 {
- let curr_id = tm... | 1 | 7 | 20 |
1c0bc3a55438ef4565f70fa4678eb38bc8a51982 | Thomas Williamson | 2020-04-17T19:42:48 | Expose NodeId | diff --git a/src/lib.rs b/src/lib.rs
index 6a415b0..2e30c9a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -89,6 +89,30 @@ impl<'input> Document<'input> {
Node { id: NodeId::new(0), d: &self.nodes[0], doc: self }
}
+ /// Returns the node of the tree with the given NodeId.
+ ///
+ /// Note: NodeId... | 1 | 44 | 19 |
b610b09e3f7f1499747eee4f587cca16a7c9cc0e | Thomas Williamson | 2020-04-11T23:30:08 | Anonymize lifetimes for Node trait impls | diff --git a/src/lib.rs b/src/lib.rs
index fc4ccbc..6a415b0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -602,9 +602,9 @@ pub struct Node<'a, 'input: 'a> {
d: &'a NodeData<'input>,
}
-impl<'a, 'input> Eq for Node<'a, 'input> {}
+impl Eq for Node<'_, '_> {}
-impl<'a, 'input> PartialEq for Node<'a, 'input> {
+im... | 1 | 5 | 5 |
3439651715893b8053787d0c6c52fb05695d6b1e | Thomas Williamson | 2020-04-11T23:00:59 | Impl Hash for Node | diff --git a/src/lib.rs b/src/lib.rs
index b6f2a8b..fc4ccbc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -24,6 +24,7 @@ use std::borrow::Cow;
use std::cmp::Ordering;
use std::fmt;
use std::num::NonZeroUsize;
+use std::hash::{Hash, Hasher};
use std::ops::Deref;
pub use xmlparser::TextPos;
@@ -632,6 +633,14 @@ impl... | 1 | 9 | 0 |
2ef009657909e138e94de961f476a03b2b9d8ebd | tomjw64 | 2020-04-05T18:59:26 | Replace next_sibling with next_subtree in NodeData
This allows us to take advantage of an optimization in the descendants
iterator along with the assumption that NodeId are in document-order,
whereby we simply iterate from a node until its next_subtree in order to
capture all of its descendents and no other nodes. | diff --git a/src/lib.rs b/src/lib.rs
index a7a45fc..b6f2a8b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -284,7 +284,7 @@ enum NodeKind<'input> {
struct NodeData<'input> {
parent: Option<NodeId>,
prev_sibling: Option<NodeId>,
- next_sibling: Option<NodeId>,
+ next_subtree: Option<NodeId>,
last_chil... | 2 | 62 | 77 |
91b50ff49d1068c239426182e572b751b020def9 | tomjw64 | 2020-04-07T15:24:39 | Add impl Ord for Node
Implemented Ord and PartialOrd for Node based on document-order,
documentation was added on the Node struct, and a test for sorting was
added. | diff --git a/src/lib.rs b/src/lib.rs
index 710b226..a7a45fc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -21,6 +21,7 @@ License: ISC.
extern crate xmlparser;
use std::borrow::Cow;
+use std::cmp::Ordering;
use std::fmt;
use std::num::NonZeroUsize;
use std::ops::Deref;
@@ -570,7 +571,25 @@ impl<'input> From<(&'inpu... | 2 | 57 | 1 |
8bb2348d9534b458ec494c47858981d657b02367 | tomjw64 | 2020-04-07T14:25:09 | Remove first child from NodeData
Relying on the assumption that NodeId are assigned in document-order, we
can quickly find a Node's first child without storing it in NodeData. We
continue to store last child, since its relative placement to its parent
is variable. The last child field can continue to be used to determ... | diff --git a/src/lib.rs b/src/lib.rs
index 6f10f6b..710b226 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -284,7 +284,7 @@ struct NodeData<'input> {
parent: Option<NodeId>,
prev_sibling: Option<NodeId>,
next_sibling: Option<NodeId>,
- children: Option<(NodeId, NodeId)>,
+ last_child: Option<NodeId>,
... | 2 | 8 | 15 |
e728b9df3459c680abc0c52476bd9412b6afa67c | tomjw64 | 2020-04-06T23:46:02 | Add benches for iter for some other libraries
Added descendant benches for xmltree and minidom as well as some
assertions to make sure the same things were being selected. Children
iteration benchmarks for left out for the other libraries because both
minidom and xmltree have Vec-backed child lists and we would only b... | diff --git a/benches/xml.rs b/benches/xml.rs
index e2d0094..9e33f42 100644
--- a/benches/xml.rs
+++ b/benches/xml.rs
@@ -163,29 +163,30 @@ fn large_minidom(bencher: &mut Bencher) {
})
}
-fn roxmltree_iter_descendants_inexpensive_matches(bencher: &mut Bencher) {
+fn roxmltree_iter_descendants_inexpensive(bencher... | 1 | 113 | 16 |
54f2e36b9477bed82e5de98bef1dda13c0f06968 | tomjw64 | 2020-04-05T22:40:26 | Add iteration benches | diff --git a/benches/xml.rs b/benches/xml.rs
index 5a3c910..e2d0094 100644
--- a/benches/xml.rs
+++ b/benches/xml.rs
@@ -163,7 +163,46 @@ fn large_minidom(bencher: &mut Bencher) {
})
}
+fn roxmltree_iter_descendants_inexpensive_matches(bencher: &mut Bencher) {
+ let text = std::fs::read_to_string("large.plis... | 1 | 40 | 1 |
a4a4e49a6abb2c8cebd9205e1f4de147372da4b3 | Evgeniy Reizner | 2020-04-02T10:25:13 | Doc fixes. | diff --git a/src/lib.rs b/src/lib.rs
index a7e9894..6f10f6b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,9 +3,9 @@ Represent an [XML 1.0](https://www.w3.org/TR/xml/) document as a read-only tree.
The root point of the documentations is [`Document::parse`].
-You can find more details in the [README] and [parsing ... | 1 | 5 | 5 |
4bf629302c904987d17d9958bd519a544fa75414 | Evgeniy Reizner | 2020-04-02T09:50:14 | Fix clippy warnings. | diff --git a/src/lib.rs b/src/lib.rs
index 4f196ff..b9320b7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -941,7 +941,7 @@ impl<'a, 'input: 'a> Node<'a, 'input> {
/// Returns the parent element of this node.
pub fn parent_element(&self) -> Option<Self> {
- self.ancestors().skip(1).filter(|n| n.is_eleme... | 2 | 6 | 6 |
5d2f31b3e1749b4d365b430f7a8d4640ec7e721b | Evgeniy Reizner | 2020-03-18T14:52:33 | Update dependencies. | diff --git a/Cargo.toml b/Cargo.toml
index 15d00d4..cbe3d5a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,7 +19,7 @@ exclude = ["test-apps", "testing-tools"]
travis-ci = { repository = "RazrFalcon/roxmltree" }
[dependencies]
-xmlparser = "0.13"
+xmlparser = "0.13.1"
[dev-dependencies]
pretty_assertions = "0.5... | 1 | 1 | 1 |
0c2303d2e20d59189f99b0fd058303de83540c56 | SirJosh3917 | 2020-03-18T14:42:48 | Add Document::input_text | diff --git a/src/lib.rs b/src/lib.rs
index b3a7c42..36b32ba 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -134,6 +134,21 @@ impl<'input> Document<'input> {
pub fn text_pos_at(&self, pos: usize) -> TextPos {
xmlparser::Stream::from(self.text).gen_text_pos_from(pos)
}
+
+ /// Returns the input text of... | 1 | 15 | 0 |
c9c5437e5ec209842c0ebffd4d4f4e59689579e0 | Evgeniy Reizner | 2019-12-11T15:56:48 | Mention the entity depth limit in the Error::EntityReferenceLoop docs. | diff --git a/src/parse.rs b/src/parse.rs
index a69fcd3..4e225fc 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -27,6 +27,7 @@ use {
Uri,
};
+// Note: update Error::EntityReferenceLoop documentation too.
const ENTITY_DEPTH: u8 = 10;
@@ -72,6 +73,8 @@ pub enum Error {
UnknownEntityReference(String, Tex... | 1 | 3 | 0 |
729640c013068140ffca1d135391dad3cf94b30d | Alexander Payne | 2019-11-13T22:53:11 | Use unconstrained lifetimes for the `attribute` functions (#17)
This commit adds unconstrained input lifetimes to the name parameters
passed in to the attribute lookup functions, so that the search text
does not need to be coupled to the lifetime of the XML parsed structures
being searched. Because the search text ... | diff --git a/src/lib.rs b/src/lib.rs
index 156bab3..701ee56 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -689,8 +689,9 @@ impl<'a, 'input: 'a> Node<'a, 'input> {
/// assert!(!doc.root_element().has_tag_name("b"));
/// assert!(!doc.root_element().has_tag_name(("http://www.w4.org", "e")));
/// ```
- pub ... | 1 | 12 | 8 |
25ecc795de7915eae13eb0f6d090f094cf27f41b | Alexander Payne | 2019-11-07T19:35:46 | Resolve lifetime error in Document::root_element
This patch ensures that the `Node` produced by
`Document::root_element` matches the lifetimes of the producing
`Document`. Prior to this patch, Rust’s lifetime-assumption model
was applying the implicit self-borrow lifetime to *both* lifetimes
of the produced `Node`... | diff --git a/src/lib.rs b/src/lib.rs
index 51547a5..90072d0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -100,9 +100,9 @@ impl<'input> Document<'input> {
/// assert!(doc.root_element().has_tag_name("e"));
/// ```
#[inline]
- pub fn root_element(&self) -> Node {
- // `unwrap` is safe, because the... | 1 | 3 | 3 |
cfe19ed5060ed13201bc2c3979d8220d9f1c8348 | Evgeniy Reizner | 2019-08-29T11:55:03 | Do not use rustc-test dependency.
Since it doesn't work with Rust 1.18 anymore. | diff --git a/Cargo.toml b/Cargo.toml
index 13999f0..d84d260 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -26,4 +26,3 @@ xmlparser = "0.9"
[dev-dependencies]
pretty_assertions = "0.5"
-rustc-test = "0.3"
diff --git a/tests/ast.rs b/tests/ast.rs
index 93c4bee..0f85a76 100644
--- a/tests/ast.rs
+++ b/tests/ast.rs
@@ -1... | 2 | 2 | 21 |
88ad0438cac4b61d447c221543b93be03ff175af | Evgeniy Reizner | 2019-08-12T08:38:05 | Inline all. | diff --git a/src/lib.rs b/src/lib.rs
index 697d1ba..3a062f3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -82,6 +82,7 @@ impl<'input> Document<'input> {
/// assert!(doc.root().is_root());
/// assert!(doc.root().first_child().unwrap().has_tag_name("e"));
/// ```
+ #[inline]
pub fn root<'a>(&'a self)... | 2 | 79 | 0 |
07ac24214bf1cacb85f2ea91c99194b12367b7db | Evgeniy Reizner | 2019-04-24T08:00:20 | Rename lifetimes. | diff --git a/src/lib.rs b/src/lib.rs
index e67b87c..84bb002 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -13,8 +13,6 @@ License: ISC.
[parsing doc]: https://github.com/RazrFalcon/roxmltree/blob/master/docs/parsing.md
*/
-#![cfg_attr(feature = "cargo-clippy", allow(collapsible_if))]
-
#![doc(html_root_url = "https:/... | 2 | 138 | 140 |
3226d6c906bfaa6568cea5d3d1b77eff5963006a | Evgeniy Reizner | 2019-03-03T20:01:26 | Refactoring. | diff --git a/src/parse.rs b/src/parse.rs
index 54c1f39..9d2a71e 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -172,10 +172,8 @@ impl error::Error for Error {
struct AttributeData<'d> {
- /// Contains prefix or local name for error position.
- name: StrSpan<'d>,
- prefix: &'d str,
- local: &'d str,
+ ... | 1 | 19 | 26 |
da963c6b4d39008d764750949a5333a9851651fd | RazrFalcon | 2019-02-01T22:13:07 | Fixed element range detection. | diff --git a/src/parse.rs b/src/parse.rs
index 25f73ec..88e6db8 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -483,13 +483,14 @@ fn process_element<'d>(
attributes,
namespaces,
},
- tag_name.span.range()
+ tag_name.span.start()..... | 2 | 6 | 3 |
fb3315cee821a370c6f90f33f3e65072dc735848 | Erich Gubler | 2019-01-05T21:14:16 | Grammar fixes (#9) | diff --git a/src/lib.rs b/src/lib.rs
index 28aee14..114ac10 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -49,13 +49,13 @@ pub const NS_XMLNS_URI: &str = "http://www.w3.org/2000/xmlns/";
/// Root, Element, PI, Comment and Text.
///
/// As you can see there are no XML declaration and CDATA types.
-/// The XML declarati... | 1 | 3 | 3 |
7a34eedca6748d665929429ecd9680371e1c1976 | Tomasz Miąsko | 2018-12-21T00:00:00 | Use longer lifetimes in return types | diff --git a/src/lib.rs b/src/lib.rs
index c868361..da77b24 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -82,7 +82,7 @@ impl<'d> Document<'d> {
/// assert!(doc.root().is_root());
/// assert!(doc.root().first_child().unwrap().has_tag_name("e"));
/// ```
- pub fn root(&self) -> Node {
+ pub fn root<'a... | 2 | 43 | 16 |
2a6a7af73876e5fabb95eba386989ae1e20f9155 | RazrFalcon | 2018-12-14T17:25:56 | Added 'badges' section to the Cargo.toml | diff --git a/Cargo.toml b/Cargo.toml
index 13540dd..d061861 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,6 +15,9 @@ readme = "README.md"
members = ["benches"]
exclude = ["testing-tools"]
+[badges]
+travis-ci = { repository = "RazrFalcon/roxmltree" }
+
[lib]
doctest = true | 1 | 3 | 0 |
11315c71896313574e46c3bf8ecfef3856d4b1b6 | RazrFalcon | 2018-12-10T10:18:42 | Fixed clippy warning. | diff --git a/src/parse.rs b/src/parse.rs
index 7c36390..1ab5aa8 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -526,12 +526,11 @@ fn resolve_namespaces(
}
}
- let mut namespaces = 0..0;
if start_idx != doc.namespaces.len() {
- namespaces = start_idx..doc.namespaces.len();
+ start_... | 1 | 3 | 4 |
f65e040fedb5357375d6f573a3a18049a66e093c | RazrFalcon | 2018-12-10T10:16:30 | Use derive for Clone traits. | diff --git a/src/lib.rs b/src/lib.rs
index 88a1e3e..cf16589 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -561,6 +561,7 @@ impl<'d> From<(&'d str, &'d str)> for ExpandedName<'d> {
/// A node.
+#[derive(Clone, Copy)]
pub struct Node<'a, 'd: 'a> {
/// Node ID.
id: NodeId,
@@ -571,12 +572,6 @@ pub struct Nod... | 1 | 7 | 47 |
44299bca4a0b90f8b3473a0c6a650ad69d864bc8 | RazrFalcon | 2018-11-15T16:05:18 | Shrink data vectors after parsing to reduce memory usage. | diff --git a/src/parse.rs b/src/parse.rs
index 497764a..7c36390 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -271,6 +271,10 @@ fn parse(text: &str) -> Result<Document, Error> {
return Err(Error::NoRootNode);
}
+ doc.nodes.shrink_to_fit();
+ doc.attrs.shrink_to_fit();
+ doc.namespaces.0.shrin... | 1 | 4 | 0 |
3ff164eebd80f1a78d8f85a7699dff62027902b4 | RazrFalcon | 2018-11-02T20:03:36 | Refactoring. | diff --git a/src/parse.rs b/src/parse.rs
index d0a0f09..497764a 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -2,6 +2,7 @@ use std::borrow::{Cow, Borrow};
use std::error;
use std::fmt;
use std::mem;
+use std::ops::Range;
use std::str;
use xmlparser::{
@@ -139,12 +140,12 @@ impl error::Error for Error {
st... | 1 | 95 | 75 |
17459594a11322c10b5180025992c6eb4a4a7182 | RazrFalcon | 2018-11-02T19:30:05 | Preallocate attributes buffer. | diff --git a/src/parse.rs b/src/parse.rs
index e0ab385..d0a0f09 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -231,7 +231,7 @@ fn parse(text: &str) -> Result<Document, Error> {
let mut pd = ParserData {
attrs_start_idx: 0,
ns_start_idx: 1,
- tmp_attrs: Vec::new(),
+ tmp_attrs: Vec... | 1 | 1 | 1 |
a78d7a99a6bb4f23f99c939c48a3a65a5d5b9a3f | RazrFalcon | 2018-10-29T13:57:56 | Fixed build on 1.18 | diff --git a/src/parse.rs b/src/parse.rs
index 7898ddc..e0ab385 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -642,7 +642,7 @@ fn append_text<'d>(
if after_text {
if let Some(node) = doc.nodes.iter_mut().last() {
if let NodeKind::Text(ref mut prev_text) = node.kind {
- match ... | 1 | 1 | 1 |
9a05702c283939c5a3229534b9cbb23e09e28c01 | RazrFalcon | 2018-10-29T09:49:52 | Refactoring | diff --git a/src/parse.rs b/src/parse.rs
index a752c31..7fd88e8 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -285,13 +285,12 @@ fn process_tokens<'d>(
let token = token?;
match token {
xmlparser::Token::ProcessingInstruction(target, content) => {
- doc.append(parent_id,
... | 1 | 50 | 59 |
77ce852dd0844a4ead237d0742478f1256f142f8 | RazrFalcon | 2018-10-29T07:57:55 | Refactoring. | diff --git a/src/lib.rs b/src/lib.rs
index 8921c9e..513fd01 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -22,10 +22,10 @@ License: ISC.
extern crate xmlparser;
+use std::borrow::Cow;
use std::fmt;
use std::ops::{Deref, Range};
use std::rc::Rc;
-use std::borrow::Cow;
pub use xmlparser::TextPos;
diff --git a/... | 2 | 133 | 100 |
a0a498d3e82824ea62d81e502658ec6977aac1c9 | RazrFalcon | 2018-10-14T18:17:09 | Refactoring. | diff --git a/benches/Cargo.toml b/benches/Cargo.toml
index 94c561c..8a09445 100644
--- a/benches/Cargo.toml
+++ b/benches/Cargo.toml
@@ -5,7 +5,7 @@ workspace = ".."
[dependencies]
roxmltree = { path = "../" }
-xmlparser = "0.6.0"
+xmlparser = "0.6.1"
bencher = "0.1"
xmltree = "0.8"
sxd-document = "0.2.6"
diff -... | 2 | 92 | 63 |
a33c70ac15bda7348ded51f8cb953ac42046b550 | RazrFalcon | 2018-09-16T11:39:16 | Fixed testing-tools/afl-fuzz build. | diff --git a/testing-tools/afl-fuzz/Cargo.toml b/testing-tools/afl-fuzz/Cargo.toml
index fa4f798..cf1925d 100644
--- a/testing-tools/afl-fuzz/Cargo.toml
+++ b/testing-tools/afl-fuzz/Cargo.toml
@@ -4,4 +4,4 @@ version = "0.1.0"
[dependencies]
afl = "0.4"
-roxmltree = { path = ".." }
+roxmltree = { path = "../.." } | 1 | 1 | 1 |
ce4cc15548569a8976f1295307f52686d82b763a | RazrFalcon | 2018-09-16T11:34:09 | Cargo.toml fixed. | diff --git a/Cargo.toml b/Cargo.toml
index 3a5ffe4..25b7c8e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,7 +17,7 @@ exclude = ["testing-tools"]
[dependencies]
#xmlparser = "0.6.0"
-xmlparser = { git = "https://github.com/RazrFalcon/xmlparser.git", rev = "8a075b2" }
+xmlparser = { git = "https://github.com/RazrFa... | 1 | 1 | 1 |
226e57e2b0e039db558226340433ff66f1d830fe | RazrFalcon | 2018-09-16T11:30:33 | Exclude testing-tools from Cargo.toml. | diff --git a/Cargo.toml b/Cargo.toml
index 9a7ea48..3a5ffe4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,6 +13,7 @@ readme = "README.md"
[workspace]
members = ["benches"]
+exclude = ["testing-tools"]
[dependencies]
#xmlparser = "0.6.0" | 1 | 1 | 0 |
e6063e9b12fbb28fa6ee5d11cf5f4da68d516879 | RazrFalcon | 2018-09-15T18:15:50 | Fixed build on an older compiler. | diff --git a/src/lib.rs b/src/lib.rs
index 3a99bee..f554321 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -769,7 +769,7 @@ impl<'a, 'd: 'a> Node<'a, 'd> {
///
/// assert_eq!(doc.root_element().lookup_namespace_uri(None), Some("http://www.w3.org"));
/// ```
- pub fn lookup_namespace_uri(&self, prefix: Op... | 1 | 1 | 1 |
ae5292584f09cc2104175e93fb4e8aa3f6115906 | RazrFalcon | 2018-08-31T16:32:09 | Cargo.toml fixes. | diff --git a/Cargo.toml b/Cargo.toml
index 71a781c..9160349 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,12 +1,12 @@
[package]
name = "roxmltree"
-# When updating version, also modify html_root_url in the lib.rs and in the README.tpl
+# When updating version, also modify html_root_url in the lib.rs and in the READM... | 1 | 2 | 2 |
0ff441ce07fdb598e294258eda0d8844365e2315 | Artyom Pavlov | 2026-04-10T15:22:55 | Add `allow(missing_docs)` for benchmarks (#111)
Addition of simple module docs is not sufficient since
`block_encryptor_bench!` creates `pub fn`. | diff --git a/belt-ctr/benches/belt-ctr.rs b/belt-ctr/benches/belt-ctr.rs
index 6ed2d8d..d2edf06 100644
--- a/belt-ctr/benches/belt-ctr.rs
+++ b/belt-ctr/benches/belt-ctr.rs
@@ -1,4 +1,5 @@
#![feature(test)]
+#![allow(missing_docs)]
extern crate test;
cipher::stream_cipher_bench!(
diff --git a/cbc/benches/aes128.rs... | 8 | 8 | 0 |
63a37c8d940bffba8b66a419cfe86f26238fc354 | Artyom Pavlov | 2026-04-10T15:10:23 | Use release versions of block cipher crates (#110) | diff --git a/Cargo.lock b/Cargo.lock
index 47acd24..9e1903a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,9 +4,9 @@ version = 4
[[package]]
name = "aes"
-version = "0.9.0-rc.4"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04097e08a47d9ad181c2e1f4a5fabc9ae06ce883... | 10 | 27 | 28 |
fe63a2be3ff48d6397ef94498a5b9bfb18d6588b | Tony Arcieri | 2026-02-27T01:45:06 | cbc+ctr: cut new prereleases (#107)
Releases the following:
- `cbc` v0.2.0-rc.4
- `ctr` v0.10.0-rc.4 | diff --git a/Cargo.lock b/Cargo.lock
index ff156b8..47acd24 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -58,7 +58,7 @@ dependencies = [
[[package]]
name = "cbc"
-version = "0.2.0-rc.3"
+version = "0.2.0-rc.4"
dependencies = [
"aes",
"cipher",
@@ -129,7 +129,7 @@ dependencies = [
[[package]]
name = "ctr"
-v... | 3 | 4 | 4 |
3dbbcf1705bbe59edf4aab8a43c693727c28bfa4 | Artyom Pavlov | 2026-02-25T15:44:48 | Bump `cipher` to v0.5.1 (#106) | diff --git a/Cargo.lock b/Cargo.lock
index 16ade51..ff156b8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -39,9 +39,9 @@ checksum = "89af0b093cc13baa4e51e64e65ec2422f7e73aea0e612e5ad3872986671622f1"
[[package]]
name = "block-buffer"
-version = "0.11.0"
+version = "0.12.0"
source = "registry+https://github.com/rust-l... | 19 | 161 | 158 |
9745ef61814dc230576836f46d374226a4c5708a | Artyom Pavlov | 2026-02-13T21:23:02 | cfb8: remove tail processing (#105)
The code was copied from the `AsyncStreamCipher` trait and can be
specialized for CFB-8. | diff --git a/cfb8/src/decrypt.rs b/cfb8/src/decrypt.rs
index 9e3425b..a19f3ef 100644
--- a/cfb8/src/decrypt.rs
+++ b/cfb8/src/decrypt.rs
@@ -73,15 +73,10 @@ where
{
/// Decrypt data using `InOutBuf`.
pub fn decrypt_inout(&mut self, data: InOutBuf<'_, '_, u8>) {
- let (blocks, mut tail) = data.into_chu... | 2 | 6 | 16 |
6f589cbaaedf6415b01584e018002533eb4435e5 | Tony Arcieri | 2026-02-13T20:33:45 | Bump `cipher` dependency to v0.5 (#98)
Release PR: RustCrypto/traits#2281 | diff --git a/Cargo.lock b/Cargo.lock
index e07aa4b..16ade51 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -92,9 +92,9 @@ checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
[[package]]
name = "cipher"
-version = "0.5.0-rc.8"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang... | 10 | 24 | 24 |
b4c5f44bbb237dc6e2c29418001cfa53ed4011c3 | Artyom Pavlov | 2026-02-13T20:32:22 | Fix links to RustCrypto/AEADs (#100) | diff --git a/cbc/src/lib.rs b/cbc/src/lib.rs
index e1e87af..0edb401 100644
--- a/cbc/src/lib.rs
+++ b/cbc/src/lib.rs
@@ -9,9 +9,11 @@
//!
//! This crate does not ensure ciphertexts are authentic! Thus ciphertext integrity
//! is not verified, which can lead to serious vulnerabilities!
-//! [AEADs][https://github.com... | 7 | 21 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.