Skip to content

Bikeshedding calling *u8 "buf" and [u8] "bytes" #3444

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

Closed
erickt opened this issue Sep 10, 2012 · 1 comment
Closed

Bikeshedding calling *u8 "buf" and [u8] "bytes" #3444

erickt opened this issue Sep 10, 2012 · 1 comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.

Comments

@erickt
Copy link
Contributor

erickt commented Sep 10, 2012

We are a little inconsistent with how we name *u8 and [u8]. Sometimes we use the term buf to mean a *u8:

str::as_buf
str::unsafe::from_buf
str::unsafe::from_buf_len
str::unsafe::from_buf_len_nocopy
vec::as_buf
vec::as_const_buf
vec::as_mut_buf

Or it could mean [u8]:

flate::deflate_buf
flate::inflate_buf
int::parse_buf
io::mem_buffer_buf
io::with_buf_writer
uint::parse_buf

In other cases, we use bytes to mean [u8]:

hash::Streaming::result_bytes
hash::hash_bytes_keyed
hash::hash_bytes
io::ReaderUtil::read_bytes
io::with_bytes_reader
rand::Rng::gen_bytes
str::from_bytes
str::to_bytes
str::as_bytes
str::as_bytes_slice
str::from_bytes
str::push_bytes
str::unsafe::from_bytes
str::unsafe::push_bytes
ToBytes::to_bytes

I think we should fix this. What would you all think about standardizing on buf being used to represent *u8, and bytes being [u8]?

@brson
Copy link
Contributor

brson commented Sep 10, 2012

Yes, please.

erickt added a commit that referenced this issue Sep 15, 2012
@erickt erickt closed this as completed Oct 2, 2012
bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
Additional info to default value of edition.
RalfJung pushed a commit to RalfJung/rust that referenced this issue Apr 6, 2024
…r=RalfJung

shims/linux: move epoll and eventfd into their own respective files

Also put the FD types into those files; they can then even be made private there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

No branches or pull requests

2 participants