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

Add an example of lossy decoding to str::Utf8Error docs #49105

Merged
merged 1 commit into from
Mar 22, 2018

Conversation

SimonSapin
Copy link
Contributor

CC #33906

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cramertj (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 17, 2018
/// }
/// push("\u{FFFD}");
///
/// match error.error_len() {
Copy link
Member

Choose a reason for hiding this comment

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

Just stylistic comment. I think that this match taking 8 lines is artificially too long, you could make it 5 lines with if let.

if let Some(invalid_sequence_length) = error.error_len() {
    input = &after_valid[invalid_sequence_length..];
} else {
    break;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does look better. Applied, thanks.

@SimonSapin SimonSapin added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels Mar 19, 2018
@SimonSapin
Copy link
Contributor Author

r? @alexcrichton

@alexcrichton
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Mar 22, 2018

📌 Commit e09dbbc has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 22, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Mar 22, 2018
… r=alexcrichton

Add an example of lossy decoding to str::Utf8Error docs

CC rust-lang#33906
bors added a commit that referenced this pull request Mar 22, 2018
@alexcrichton alexcrichton merged commit e09dbbc into rust-lang:master Mar 22, 2018
@SimonSapin SimonSapin deleted the from_utf8_lossy_example branch March 30, 2018 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants