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

Proofread some code/docs #1108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Proofread some code/docs #1108

wants to merge 1 commit into from

Conversation

nyurik
Copy link

@nyurik nyurik commented Oct 16, 2023

Possible TODOs (not blocking):

  • I wasn't sure if escapeable should be replaced by escapable -- too many occurrences to replace
  • determinizing is another weird one
  • There are some "Padron" -- is that intentional?

Copy link
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, you caught a lot of mistakes! Nice. Some of these I'm not so sure about, particularly the ones with hyphens, and I'm unlikely to remain consistent with all of them in the future. But I'm not too worried about it.

  1. Yes, "escapeable" should just be "escapable." I just apparently don't know how to spell that word. (I suppose one could say I don't know how to spell a lot of words, haha, but I think a lot of these are typos.)
  2. "determinizing" seems fine to me? Not sure what the alternative is.
  3. "Padron" is a type of cigar. It's intentional. :-)

Otherwise just a few small nits and this should be good to go.

@@ -772,7 +772,7 @@ fn write_varu32(data: &mut Vec<u8>, mut n: u32) {
///
/// https://developers.google.com/protocol-buffers/docs/encoding#varints
fn read_varu32(data: &[u8]) -> (u32, usize) {
// N.B. We can assume correctness here since we know that all varuints are
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "varuints" is what I actually meant here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect most people will automatically read "variants", defeating the purpose :) Can you think of another word for this, e.g. "var-u32"?

@@ -370,7 +370,7 @@ pub(crate) fn alloc_aligned_buffer<T>(size: usize) -> (Vec<u8>, usize) {
// NOTE: This is a kludge because there's no easy way to allocate a Vec<u8>
// with an alignment guaranteed to be greater than 1. We could create a
// Vec<u32>, but this cannot be safely transmuted to a Vec<u8> without
// concern, since reallocing or dropping the Vec<u8> is UB (different
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I meant "reallocing" here, as in "to call realloc." I suppose "reallocating" is close enough, but I think I like "reallocing" better? I don't feel strongly.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will revert it

* `escapeable` should be replaced by `escapable`, but it is part of a pub fn
@nyurik
Copy link
Author

nyurik commented Oct 16, 2023

Ok, i fixed them all, with the exception of pub fn is_escapeable_character(...) -- I will submit another PR for that with a obsolete fn

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 this pull request may close these issues.

None yet

2 participants