Giter VIP home page Giter VIP logo

Comments (10)

tafia avatar tafia commented on August 23, 2024 2

Event is the primary enum returned in quick_xml. I think it wouldn't make sense for it not to own its content (in particular when reading the xml).

On the other hand, Writer::write_event takes a AsRef<Event> but you're using write_event(event).

So if instead you decide to use write_event(&event), you could then get back the event (if let Event(start) = event) and do whatever you need.

I haven't tried it on your code but it should work.

from inferno.

meven avatar meven commented on August 23, 2024 1

FYI, I have opened a PR in quick-xml repo tafia/quick-xml#149 to fix tafia/quick-xml#148

from inferno.

meven avatar meven commented on August 23, 2024 1

I would probably work on this on top of #32 rather than current master since it's about to be merged, and moves a lot of code around.

Good suggestion, I can do that.

from inferno.

jonhoo avatar jonhoo commented on August 23, 2024

Now that tafia/quick-xml#149 has landed, this should be easy-peasy! :D

from inferno.

meven avatar meven commented on August 23, 2024

Now that tafia/quick-xml#149 has landed, this should be easy-peasy! :D

Well we just need to wait for a quick-xml release now.

from inferno.

jonhoo avatar jonhoo commented on August 23, 2024

@meven I would start working with quick-xml as a git dependency, and then we can just hold off on releasing until a new release of quick-xml is made :)

from inferno.

meven avatar meven commented on August 23, 2024

Having a look unfortunately Event::Start consumes the BytesStart.
We will need a clone() unfortunately.

from inferno.

jonhoo avatar jonhoo commented on August 23, 2024

Ah, that's unfortunate. The clone will at least mean that we're unlikely to do multiple memory allocations though. @tafia any idea how we may be able to do this without allocation, given that Event;;Start consumes BytesStart (as opposed to taking a &BytesStart)?

from inferno.

jonhoo avatar jonhoo commented on August 23, 2024

We should also do this for the rect and a elements, since they're also in the main loop. /cc @meven

from inferno.

jonhoo avatar jonhoo commented on August 23, 2024

I would probably work on this on top of #32 rather than current master since it's about to be merged, and moves a lot of code around.

from inferno.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.