diff options
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; |