Re: [PATCH v1 1/5] rust: time: Change Delta methods to take &self instead of self

From: Alice Ryhl
Date: Mon Jun 02 2025 - 04:23:44 EST


On Sun, May 04, 2025 at 01:59:54PM +0900, FUJITA Tomonori wrote:
> Change several methods of the `Delta` type in Rust to take `&self`
> instead of `self`. These methods do not mutate or consume the `Delta`
> value and are more idiomatically expressed as taking a shared
> reference. This change improves consistency with common Rust practice
> and allows calling these methods on references without requiring an
> explicit copy or move of the value.

For small values that can be freely copied, I actualy think that using
`self` is more common Rust practice.

Alice