Skip to content

documentation incorrectly described from_utf8 #19623

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

Merged
merged 1 commit into from
Dec 9, 2014

Conversation

rustyrazorblade
Copy link
Contributor

Docs said from_utf8 accepts a vector when it actually accepts an array of bytes.

@steveklabnik
Copy link
Member

Thank you!!!

@@ -76,7 +76,7 @@ impl FromStr for bool {
Section: Creating a string
*/

/// Converts a vector to a string slice without performing any allocations.
/// Converts an array of bytes to a string slice without performing any allocations.
Copy link
Member

Choose a reason for hiding this comment

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

I believe the preferred terminology here is "slice of bytes". "Array of bytes" implies e.g. [u8, ..10].

Copy link
Member

Choose a reason for hiding this comment

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

ahh you are correct: I missed the & because of the lifetime 😅

@rustyrazorblade mind updating please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure no problem

@rustyrazorblade
Copy link
Contributor Author

Alright, updated.

@steveklabnik
Copy link
Member

Sorry, would you mind squashing?

Docs said from_utf8 accepts a vector when it actually accepts a slice of bytes.
@rustyrazorblade
Copy link
Contributor Author

Sure. Rebased & squashed.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 9, 2014
Docs said from_utf8 accepts a vector when it actually accepts an array of bytes.
@bors bors merged commit 956c581 into rust-lang:master Dec 9, 2014
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.

4 participants