diff options
author | Martin Fischer <martin@push-f.com> | 2021-04-08 10:25:09 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-04-08 15:40:48 +0200 |
commit | 8bb20dcdeec57b2109b05351663ec1dba9c65f84 (patch) | |
tree | 3ddf7196d2fe66d92e4819c362e248cb96be3c0b /src/util/buffer_queue.rs | |
parent | fc9d3132f390b038544e45048b4fe345a3d47793 (diff) |
drop markup5ever dependency
Diffstat (limited to 'src/util/buffer_queue.rs')
-rw-r--r-- | src/util/buffer_queue.rs | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/util/buffer_queue.rs b/src/util/buffer_queue.rs index d572489..7f8c3cc 100644 --- a/src/util/buffer_queue.rs +++ b/src/util/buffer_queue.rs @@ -123,31 +123,6 @@ impl BufferQueue { /// Pops and returns either a single character from the given set, or /// a buffer of characters none of which are in the set. - /// - /// # Examples - /// - /// ``` - /// # #[macro_use] extern crate markup5ever; - /// # #[macro_use] extern crate tendril; - /// # fn main() { - /// use markup5ever::buffer_queue::{BufferQueue, SetResult}; - /// - /// let mut queue = BufferQueue::new(); - /// queue.push_back(format_tendril!(r#"<some_tag attr="text">SomeText</some_tag>"#)); - /// let set = small_char_set!(b'<' b'>' b' ' b'=' b'"' b'/'); - /// let tag = format_tendril!("some_tag"); - /// let attr = format_tendril!("attr"); - /// let attr_val = format_tendril!("text"); - /// assert_eq!(queue.pop_except_from(set), Some(SetResult::FromSet('<'))); - /// assert_eq!(queue.pop_except_from(set), Some(SetResult::NotFromSet(tag))); - /// assert_eq!(queue.pop_except_from(set), Some(SetResult::FromSet(' '))); - /// assert_eq!(queue.pop_except_from(set), Some(SetResult::NotFromSet(attr))); - /// assert_eq!(queue.pop_except_from(set), Some(SetResult::FromSet('='))); - /// assert_eq!(queue.pop_except_from(set), Some(SetResult::FromSet('"'))); - /// assert_eq!(queue.pop_except_from(set), Some(SetResult::NotFromSet(attr_val))); - /// // ... - /// # } - /// ``` pub fn pop_except_from(&mut self, set: SmallCharSet) -> Option<SetResult> { let (result, now_empty) = match self.buffers.front_mut() { None => (None, false), @@ -181,23 +156,6 @@ impl BufferQueue { /// it wasn't possible to know (more data is needed). /// /// The custom comparison function is used elsewhere to compare ascii-case-insensitively. - /// - /// # Examples - /// - /// ``` - /// # extern crate markup5ever; - /// # #[macro_use] extern crate tendril; - /// # fn main() { - /// use markup5ever::buffer_queue::{BufferQueue}; - /// - /// let mut queue = BufferQueue::new(); - /// queue.push_back(format_tendril!("testtext")); - /// let test_str = "test"; - /// assert_eq!(queue.eat("test", |&a, &b| a == b), Some(true)); - /// assert_eq!(queue.eat("text", |&a, &b| a == b), Some(true)); - /// assert!(queue.is_empty()); - /// # } - /// ``` pub fn eat<F: Fn(&u8, &u8) -> bool>(&mut self, pat: &str, eq: F) -> Option<bool> { let mut buffers_exhausted = 0; let mut consumed_from_last = 0; |