You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using quick-xml = "0.31.0", in the following code:
letmut reader = Reader::from_str(xml);//xml is an &strletmut buf = Vec::new();loop{match reader.read_event_into(&mut buf){Err(e) => panic!("Error at position {}: {:?}", reader.buffer_position(), e),Ok(Event::Eof) => break,Ok(Event::Start(ref e)) => println!("Found Start: {:?}", String::from_utf8_lossy(e)),Ok(Event::End(ref e)) => println!("Found End: {:?}", String::from_utf8_lossy(e)),Ok(Event::Text(e)) => {println!("{}", e.name());}
_ => {}};}
Rust doesn't compile with the error:
error[E0599]: no method named `name` found for struct `BytesText<'_>` in the current scope
--> src\main.rs:79:34
|
79 | println!("{}", e.name());
| ^^^^ method not found in `BytesText<'_>`
The text was updated successfully, but these errors were encountered:
Yes, because BytesText has no such method, it represents the text (in opposite to markup) of XML. You probably confused it with BytesStart or BytesEnd.
Using
quick-xml = "0.31.0"
, in the following code:Rust doesn't compile with the error:
The text was updated successfully, but these errors were encountered: