From 10038ca9d03efb9734ba4c9b9eef54c0ec3c9868 Mon Sep 17 00:00:00 2001 From: Daniel Alley Date: Sun, 14 Aug 2022 01:37:53 -0400 Subject: [PATCH] temp2 --- src/reader/mod.rs | 50 ----------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/src/reader/mod.rs b/src/reader/mod.rs index 5d0b8a40..7014dca6 100644 --- a/src/reader/mod.rs +++ b/src/reader/mod.rs @@ -306,56 +306,6 @@ impl Reader { /// Consumes `Reader` returning the underlying reader /// /// Can be used to compute line and column of a parsing error position - /// - /// # Examples - /// - /// ``` - /// # use pretty_assertions::assert_eq; - /// use std::{str, io::Cursor}; - /// use quick_xml::Reader; - /// use quick_xml::events::Event; - /// - /// let xml = r#" - /// Test - /// Test 2 - /// "#; - /// let mut reader = Reader::from_reader(Cursor::new(xml.as_bytes())); - /// let mut buf = Vec::new(); - /// - /// fn into_line_and_column(reader: Reader>) -> (usize, usize) { - /// let end_pos = reader.buffer_position(); - /// let mut cursor = reader.into_inner(); - /// let s = String::from_utf8(cursor.into_inner()[0..end_pos].to_owned()) - /// .expect("can't make a string"); - /// let mut line = 1; - /// let mut column = 0; - /// for c in s.chars() { - /// if c == '\n' { - /// line += 1; - /// column = 0; - /// } else { - /// column += 1; - /// } - /// } - /// (line, column) - /// } - /// - /// loop { - /// match reader.read_event_into(&mut buf) { - /// Ok(Event::Start(ref e)) => match e.name().as_ref() { - /// "tag1" | "tag2" => (), - /// tag => { - /// assert_eq!("tag3", tag); - /// assert_eq!((3, 22), into_line_and_column(reader)); - /// break; - /// } - /// }, - /// Ok(Event::Eof) => unreachable!(), - /// _ => (), - /// } - /// buf.clear(); - /// } - /// ``` pub fn into_inner(self) -> R { self.reader }