Skip to content
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

Clean up as_byte_slice vs as_bytes (etc) #5815

Closed
Manishearth opened this issue Nov 13, 2024 · 0 comments · Fixed by #5816
Closed

Clean up as_byte_slice vs as_bytes (etc) #5815

Manishearth opened this issue Nov 13, 2024 · 0 comments · Fixed by #5816

Comments

@Manishearth
Copy link
Member

The zerovec crate uses byte_slice and bytes to talk about methods working with &[u8]. We should pick one (I suggest as_bytes() etc since that's what the stdlib does)

$ rg "\b[a-zA-Z_]*_byte_slice[a-zA-Z_]*\b" --no-filename --only-matching -N | sort -u
as_byte_slice
from_byte_slice_unchecked
from_byte_slice_unchecked_mut
impl_byte_slice_signed_type
impl_byte_slice_size
impl_byte_slice_type
impl_byte_slice_unsigned_type
iule_from_byte_slice_unchecked_mut
parse_byte_slice
parse_byte_slice_with_length
parse_owned_byte_slice
validate_byte_slice
*_bytes* usage
$ rg "\b[a-zA-Z_]*_bytes[a-zA-Z_]*\b" --no-filename --only-matching -N | sort -u
as_bytes
as_encoded_bytes
bincode_bytes
_bytes
char_bytes
deserialize_bytes
from_bytes
from_bytes_unchecked
from_bytes_unchecked_mut
from_bytes_unchecked_with_length
from_le_bytes
get_bytes_at_mut
get_serializable_bytes_non_empty
indices_bytes
into_bytes
large_hashmap_postcard_bytes
large_zerohashmap_postcard_bytes
large_zeromap_postcard_bytes
last_field_bytes
le_bytes
len_bytes
postcard_bytes
serialize_bytes
shift_bytes
to_be_bytes
to_le_bytes
try_from_bytes
ule_bytes
unsized_bytes
visit_borrowed_bytes
vzv_from_bytes
write_serializable_bytes
write_serializable_bytes_without_length
zv_bytes

Everything but the impl ones should probably be changed,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant