[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241007.182920.1572597460085693509.fujita.tomonori@gmail.com>
Date: Mon, 07 Oct 2024 18:29:20 +0900 (JST)
From: FUJITA Tomonori <fujita.tomonori@...il.com>
To: aliceryhl@...gle.com
Cc: fujita.tomonori@...il.com, finn@...enk.dev, netdev@...r.kernel.org,
rust-for-linux@...r.kernel.org, andrew@...n.ch, hkallweit1@...il.com,
tmgross@...ch.edu, ojeda@...nel.org, alex.gaynor@...il.com,
gary@...yguo.net, bjorn3_gh@...tonmail.com, benno.lossin@...ton.me,
a.hindborg@...sung.com, anna-maria@...utronix.de, frederic@...nel.org,
tglx@...utronix.de, arnd@...db.de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v2 1/6] rust: time: Implement PartialEq and
PartialOrd for Ktime
On Mon, 7 Oct 2024 10:41:23 +0200
Alice Ryhl <aliceryhl@...gle.com> wrote:
>> >> Implement PartialEq and PartialOrd trait for Ktime by using C's
>> >> ktime_compare function so two Ktime instances can be compared to
>> >> determine whether a timeout is met or not.
>> >
>> > Why is this only PartialEq/PartialOrd? Could we either document why or implement Eq/Ord as well?
>>
>> Because what we need to do is comparing two Ktime instances so we
>> don't need them?
>
> When you implement PartialEq without Eq, you are telling the reader
> that this is a weird type such as floats where there exists values
> that are not equal to themselves. That's not the case here, so don't
> confuse the reader by leaving out `Eq`.
Understood. I'll add Eq/Ord in the next version.
Powered by blists - more mailing lists