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

Doc Rectification #204

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

Conversation

postmeback
Copy link

Fixes #139

Doc Changes

@@ -565,7 +565,7 @@ pub fn validate(slice: &[u8]) -> Result<(), Utf8Error> {
///
/// When unsuccessful, `None` is returned along with the number of bytes that
/// make up a maximal prefix of a valid UTF-8 code unit sequence. In this case,
/// the number of bytes consumed is always between 0 and 3, inclusive, where
/// the number of bytes consumed is always between 1 and 3, inclusive, where
Copy link
Owner

Choose a reason for hiding this comment

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

This still doesn't flow right to me. Because we say between "1 and 3," but then use language as if we said "0 and 3."

Copy link
Author

Choose a reason for hiding this comment

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

Okay. How about the below one:

When unsuccessful, None is returned along with the number of bytes that make up a maximal prefix of a valid UTF-8 code unit sequence. This number will always be at least 1 byte, as the function will always consume at least one byte from the input slice.

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.

Clarify None case in bstr::decode_utf8
2 participants