curve25519-dalek-source/curve25519-dalek-derive/src
Tony Arcieri cf7b099585
curve: rename FieldElement*::as_bytes => ::to_bytes (#767)
* curve: rename `FieldElement*::as_bytes` => `::to_bytes`

Methods named `as_*` should perform a zero-cost  borrowing conversion:

https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv

Methods named `to_*` can perform an expensive owned conversion.

Since the `FieldElement*` types are technically part of the public API
(but feature gated), this also preserves the old names with a
deprecation. We can remove them in the next breaking release.

The same change was also made to the backend `Scalar*` types, however
these types are not a part of the public API.
2025-06-06 15:10:29 -06:00
..
lib.rs curve: rename FieldElement*::as_bytes => ::to_bytes (#767) 2025-06-06 15:10:29 -06:00