Git Product home page Git Product logo

Comments (4)

 avatar commented on August 29, 2024

Wayy back when I started x11-rs, I figured it would be best to start with minimal derives because it's more practical to add new ones than to remove any that are unnecessary. Having Debug would definitely be nice, especially for error structs such as XErrorEvent, and I don't see any problems with it. I'd add it myself, but with my school load these days, I haven't had much time for this or any of my programming projects.

from x11-rs.

yoanlcq avatar yoanlcq commented on August 29, 2024

I'm in quite a similar situation myself, but yeah I'd still be willing to spend some time on it and make a PR then. It looks more time-consuming than actually hard, at least for Debug.

In short, I'd be in to make as many structs as possible derive Debug, Eq and PartialEq, but NOT Default, Hash, Ord, PartialOrd, Copy and Clone, as there's practically no use case for these (In particular Copy and Clone would be dishonest most of the time because of pointers etc).
Even then, these could be added later on a case-by-case basis.

from x11-rs.

wolfiestyle avatar wolfiestyle commented on August 29, 2024

I noticed this too, having Debug derived would by really helpful. Deriving PartialEq / Eq should be safe for any struct that doesn't contain pointers.

Could also implement Debug for XEvent, since it's basically a sum type. Just have to manually use the discriminant.

from x11-rs.

yoanlcq avatar yoanlcq commented on August 29, 2024

I'd just like to correct my earlier claim and point out that sadly, I'm not actually going to have the time to make a fork and fix this, at least not in the next few weeks.
Perhaps it's just a matter of doing a rough "find-and-replace" and then fixing tidbits but I haven't tried.

from x11-rs.

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.