-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audit API naming #871
Comments
I have a scratchpad of name correspondences here: https://docs.google.com/spreadsheets/d/1o_ll7S3iW7xe3UdG_t8hzjBmUD-uRHXKyxZXJ7i1D2g/edit?usp=sharing We do have some minor naming inconsistencies between This pattern does not apply to As a point of brevity: I wonder if we should drop the The placement of |
Also: When we add KnownLayout APIs in #996, we need to bikeshed their names too. |
Add `ref_` prefix to `from_{prefix,suffix}_with_trailing_elements` to be consistent with other methods. Makes progress on #871
Add `ref_` prefix to `from_{prefix,suffix}_with_trailing_elements` to be consistent with other methods. Makes progress on #871
Add `ref_` prefix to `from_{prefix,suffix}_with_trailing_elements` to be consistent with other methods. Makes progress on #871
Add `ref_` prefix to `from_{prefix,suffix}_with_trailing_elements` to be consistent with other methods. Makes progress on #871
Re. the count-taking methods: Current contenders include Personally, I'm inclined towards the briefer option. I'd also argument that For even more bevity, we could even do: $ echo {,count_}{mut,ref}_from{,_prefix,_suffix} | tr ' ' '\n'
mut_from_prefix
mut_from_suffix
ref_from
ref_from_prefix
ref_from_suffix
count_mut_from
count_mut_from_prefix
count_mut_from_suffix
count_ref_from
count_ref_from_prefix
count_ref_from_suffix The longest identifier here is only 22 characters long. Personally, I'm a little attached to having all of our identifiers on |
Discussed offline, and decided to go with |
Makes progress on #871
In `FromBytes` method names, replace `with_trailing_elements` with `with_elems`. Makes progress on #871
In `FromBytes` method names, replace `with_trailing_elements` with `with_elems`. Makes progress on #871
This commit makes some progress, but more remain to be added. Makes progress on #871
In `FromBytes` method names, replace `with_trailing_elements` with `with_elems`. Makes progress on #871
This commit makes some progress, but more remain to be added. Makes progress on #871
...to `ref_from_bytes[_with_elems]`. This brings the names in line with the `Ref` methods of the same names, and avoids the awkward name `ref_from_with_elems`. Similarly, rename `Ref::unaligned_from` to `unaligned_from_bytes`. We had already renamed `unaligned_from_with_elems` to `unaligned_from_bytes_with_elems`. Makes progress on #871
...to `ref_from_bytes[_with_elems]`. This brings the names in line with the `Ref` methods of the same names, and avoids the awkward name `ref_from_with_elems`. Similarly, rename `Ref::unaligned_from` to `unaligned_from_bytes`. We had already renamed `unaligned_from_with_elems` to `unaligned_from_bytes_with_elems`. Makes progress on #871
...to `ref_from_bytes[_with_elems]`. This brings the names in line with the `Ref` methods of the same names, and avoids the awkward name `ref_from_with_elems`. Similarly, rename `Ref::unaligned_from` to `unaligned_from_bytes`. We had already renamed `unaligned_from_with_elems` to `unaligned_from_bytes_with_elems`. Makes progress on #871
...to `ref_from_bytes[_with_elems]`. This brings the names in line with the `Ref` methods of the same names, and avoids the awkward name `ref_from_with_elems`. Similarly, rename `Ref::unaligned_from` to `unaligned_from_bytes`. We had already renamed `unaligned_from_with_elems` to `unaligned_from_bytes_with_elems`. Makes progress on #871
- Rename some non-deprecated `FromBytes` methods: - `mut_from` -> `mut_from_bytes` - `mut_from_with_elems` -> `mut_from_bytes_with_elems` - `read_from` -> `read_from_bytes` - Add missing deprecated `Ref` methods: - `new_unaligned` - `new_unaligned_from_prefix` - `new_unaligned_from_suffix` - In `FromBytes`, coalesce deprecated methods at the end of the trait - Update names in deprecation messages (some names were stale) - Make all deprecated methods return `Option`s rather than `Result`s, consistent with their equivalents on 0.7 - Mark all deprecated methods as `#[inline(always)]` Makes progress on #871
- Rename some non-deprecated `FromBytes` methods: - `mut_from` -> `mut_from_bytes` - `mut_from_with_elems` -> `mut_from_bytes_with_elems` - `read_from` -> `read_from_bytes` - Add missing deprecated `Ref` methods: - `new_unaligned` - `new_unaligned_from_prefix` - `new_unaligned_from_suffix` - In `FromBytes`, coalesce deprecated methods at the end of the trait - Update names in deprecation messages (some names were stale) - Make all deprecated methods return `Option`s rather than `Result`s, consistent with their equivalents on 0.7 - Mark all deprecated methods as `#[inline(always)]` Makes progress on #871
- `try_mut_from` -> `try_mut_from_bytes` - `try_read_from` -> `try_read_from_bytes` - `try_ref_from` -> `try_ref_from_bytes` Makes progress towards #871
- `try_mut_from` -> `try_mut_from_bytes` - `try_read_from` -> `try_read_from_bytes` - `try_ref_from` -> `try_ref_from_bytes` Makes progress towards #871
Progress
FromBytes::ref_from_prefix
inconsistent withFromBytes::from_prefix_with_trailing_elements
?with_trailing_elements
withwith_elems
in method nameswith_elems
suffix #1245#[doc(hidden)]
pub
functions/methods - finalize naming or delete#[doc(hidden)]
and#[deprecated]
#[deprecated]
attributes were added)TODO(#871)
commentsRef::from
cause inference issues since Rust thinks it might beFrom::from
rather than inherent?with_elems
Ref
constructors #1258Ref::unaligned_from
tounaligned_from_bytes
FromBytes::ref_from[_with_elems]
toref_from_bytes[_with_elems]
FromBytes::read_from
toread_from_bytes
?TryFromBytes
methods for naming consistency w/FromBytes
methodsTryFromBytes
methods for consistency withFromBytes
#1475Ref
methods returnOption
s instead ofResult
s (ie, consistent with old signatures)?Details
In the same vein as #253, we should audit our API for:
Also see #284, the "Naming" section of #1095
The text was updated successfully, but these errors were encountered: