ebarnard / rust-plist

A rusty plist parser.
MIT License
71 stars 42 forks source link

Using quick-xml #68

Closed madig closed 1 year ago

madig commented 3 years ago

I see in the 1.0 checklist that you'd like to use quick-xml for the XML part. Me too. What specifically would need to be done?

ebarnard commented 3 years ago

quick_xml::Reader requires B: BufRead instead of just B: Read.

I was planning to wait until specialisation was stable so that we can wrap our R: Read in a BufReader if not R: BufRead. Not sure if there's a hacky way to implement this now.

ozgunozerk commented 2 years ago

Any updates on this one? If you need any help, I can volunteer

ebarnard commented 2 years ago

I've added this to V1.4 as a nice-to-have. I'm not sure if I'll have time to work on it or if @pr2502 has time to finish #78, and would be very happy to accept a PR switching to quick-xml.

It doesn't look like min_specialization is going to hit stable any time soon so we'll have to make do without.

A way forward would be to add plist::from_buf_reader_xml<R: BufRead>(...) to complement the existing plist::from_reader_xml<R: Read>(...) for those who care about performance, or already have a type implementing BufRead and know they're going to be reading an XML plist.

Then, when specialization becomes stable, we can specialise for BufRead on the R: Read parameter of plist::from_reader_xml and plist::from_reader and deprecate plist::from_buf_reader_xml.

ozgunozerk commented 2 years ago

Thanks for this introduction. I'd like to work on this after I finish my current workload. It seems like I will have the time (most probably, but I cannot promise). 👍

jcgruenhage commented 1 year ago

I've wanted to look into a plist file I couldn't parse again, and before looking deeper into #52, I decided to look into the quick-xml topic again. #88 now contains an up-to-date port to quick-xml, mostly based on @pr2502's work, but with the remaining mentioned issues fixed up and it being rebased on master. The test suite now fully passes again, so if some people could try it out, that'd be great.

ebarnard commented 1 year ago

Closed by #88. Thank you again @jcgruenhage for your work on this.