Skip to content

Add examples for from_utf8_owned, from_char, from_chars, from_byte on str #15301

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
Jul 1, 2014
Merged

Add examples for from_utf8_owned, from_char, from_chars, from_byte on str #15301

merged 1 commit into from
Jul 1, 2014

Conversation

jasonthompson
Copy link
Contributor

No description provided.

@@ -97,6 +97,15 @@ Section: Creating a string
///
/// Returns `Err` with the original vector if the vector contains invalid
/// UTF-8.
///
/// #Example
Copy link
Member

Choose a reason for hiding this comment

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

# Example

@jasonthompson
Copy link
Contributor Author

Thanks again for your helpful feedback, huonw. I've integrated your suggestions.

/// let string = str::from_byte(66u8);
/// assert_eq!(string.as_slice(), "B");
/// let string = str::from_byte(104u8);
/// assert_eq!(string.as_slice(), "h");
Copy link
Member

Choose a reason for hiding this comment

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

You can probably drop the u8 suffix on the 104 literal in this case.

@alexcrichton
Copy link
Member

Thanks for this!

@jasonthompson
Copy link
Contributor Author

Integrated Alex's suggestions.

@bors bors closed this Jul 1, 2014
@bors bors merged commit 7e9bb8b into rust-lang:master Jul 1, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 17, 2023
…=lnicola

Support reading uncompressed proc macro metadata

rust-lang#113695 makes the dylib metadata uncompressed for perf reasons. This commit allows reading both the current compressed and future uncompressed dylib metadata.
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