We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Look at this broken piece of code:
let mut xml = Reader::from_reader(...); let (tx, rx) = mpsc::channel::<Event>(); let mut buf = Vec::new(); loop { let ev = xml.read_event(&mut buf); tx.send(ev.unwrap()); } }
I'd like to decode the XML in one thread and send the events via a channel. Do you have a minimum example on how to do this?
The text was updated successfully, but these errors were encountered:
This code is worked for me:
/// Regression test for https://github.com/tafia/quick-xml/issues/360 #[test] fn issue360() { let mut r = Reader::from_str("<tag1 attr1='line 1\nline 2'></tag1>"); let (tx, rx) = std::sync::mpsc::channel::<Event>(); loop { match r.read_event() { Ok(Event::Eof) => break, ev => tx.send(ev.unwrap()).unwrap(), } } std::thread::spawn(move || { // Ok(Start(BytesStart { buf: Borrowed("tag1 attr1='line 10xAline 2'"), name_len: 4 })) println!("{:?}", rx.recv()); }).join().unwrap(); }
@derolf, It that is not what you want, please add a comment
Sorry, something went wrong.
Add regression test for tafia#360
97d5ff5
Add regression test for #360
c6270f6
No branches or pull requests
Look at this broken piece of code:
I'd like to decode the XML in one thread and send the events via a channel. Do you have a minimum example on how to do this?
The text was updated successfully, but these errors were encountered: