Skip to content

Conversation

@postmeback
Copy link

Fixes #139

Doc Changes

/// 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