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
API I naming is kind of weird and inconsistent, Uuid is Copy but Uuid::as_bytes exists? Why not Uuid::into_bytes, theres no Uuid::as_mut_bytes anyway? This also matches the Rust API Guidelines C-CONV.
The text was updated successfully, but these errors were encountered:
We end up calling this as_bytes because it takes self by reference and returns a reference with the same lifetime. It's a free conversion. If we were taking self by-value and producing a by-value result then we'd use into_bytes. There isn't any as_mut_bytes because Uuid is immutable (it's a bit of a footgun to have mutable methods on Copy types).
So I think the current naming we've got is ok here.
Based on #461 ny @DianaNites
API I naming is kind of weird and inconsistent,
Uuid
isCopy
butUuid::as_bytes
exists? Why notUuid::into_bytes
, theres noUuid::as_mut_bytes
anyway? This also matches the Rust API Guidelines C-CONV.The text was updated successfully, but these errors were encountered: