-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
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
Implement common Std traits on many types #3796
Conversation
b60f794
to
7b5c899
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly fine to me
@@ -486,7 +492,7 @@ unsafe impl rwh_05::HasRawDisplayHandle for ActiveEventLoop { | |||
/// | |||
/// - A zero-sized type that is likely optimized out. | |||
/// - A reference-counted pointer to the underlying type. | |||
#[derive(Clone)] | |||
#[derive(Clone, PartialEq, Eq)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the user story for this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha!
I would honestly not be able to come up with one.
Happy to remove it if you don't like it!
Notable implementations:
DeviceId
:Default
, usesDeviceId::dumy()
.ActiveEventLoop
,EventLoop
,EventLoopProxy
: refrained from implementing anymore thenDebug
because they should be unique.EventLoopBuilder
:Eq
,Hash
andPartialEq
.InnerSizeWriter
: refrained from implementingHash
.OwnedDisplayHandle
:Eq
andPartialEq
.KeyLocation
,ModifiersKeyState
:Ord
andPartialOrd
.AnyThread
:Clone
.Window
:Eq
,Hash
andPartialEq
viaWindowId
.Replaced
Debug
implementations usingf.pad("Type { .. }")
withf.debug_struct("Type").finish_non_exhaustive()
.Let me know if anything is too contentious and I can remove it.
Follows C-COMMON-TRAITS.