You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm very new to Rust, so this could be misunderstanding the language and/or the library, but it seems that DateTime#signed_duration_since could borrow the value as read-only since it is a non-mutating action (or DateTime could implement the Copy trait).
As is, clients are forced to clone() both the left and right side of the expression -- which seems like an unnecessary requirement for a method that calculates their difference and returns an OldDuration.
I'm happy to create a PR that adds a borrowed_signed_duration_since interface (to avoid a breaking change in the existing interface), but would appreciate somebody with more experience to first chime in and let me know that it's a reasonable change. This would be my first Rust PR.
:o)
The text was updated successfully, but these errors were encountered:
I'm very new to Rust, so this could be misunderstanding the language and/or the library, but it seems that
DateTime#signed_duration_since
could borrow the value as read-only since it is a non-mutating action (orDateTime
could implement theCopy
trait).As is, clients are forced to
clone()
both the left and right side of the expression -- which seems like an unnecessary requirement for a method that calculates their difference and returns anOldDuration
.I'm happy to create a PR that adds a
borrowed_signed_duration_since
interface (to avoid a breaking change in the existing interface), but would appreciate somebody with more experience to first chime in and let me know that it's a reasonable change. This would be my first Rust PR.:o)
The text was updated successfully, but these errors were encountered: