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

fix str::split_at_mut() example #32941

Merged
merged 1 commit into from
Apr 15, 2016
Merged

fix str::split_at_mut() example #32941

merged 1 commit into from
Apr 15, 2016

Conversation

bungcip
Copy link
Contributor

@bungcip bungcip commented Apr 13, 2016

fix documentation issue #32933

@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 @gankro (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.

@alexcrichton
Copy link
Member

@bors: r+ 2bf0003 rollup

Thanks!

@GuillaumeGomez
Copy link
Member

Showing what's different with the split_at method would have been nice. Here, you just changed the mutability and didn't show what it was used for.

Don't you agree @alexcrichton?

@alexcrichton
Copy link
Member

Sure!

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Apr 14, 2016
fix str::split_at_mut() example

fix documentation issue rust-lang#32933
@GuillaumeGomez
Copy link
Member

Arf, I guess it's too late to r- the PR...

bors added a commit that referenced this pull request Apr 14, 2016
@bors bors merged commit 2bf0003 into rust-lang:master Apr 15, 2016
@bungcip
Copy link
Contributor Author

bungcip commented Apr 15, 2016

@GuillaumeGomez, well actually I want to create a different example using asciiExt trait but according to https://doc.rust-lang.org/std/ascii/trait.AsciiExt.html#tymethod.make_ascii_uppercase,
that function is unstable. I don't want to create example that only work on nightly.

fn main() {
    use std::ascii::AsciiExt;
    let mut s = "Per Martin-Löf".to_string();

    {
        let (first, last) = s.split_at_mut(3);

        first.make_ascii_uppercase();
        last.make_ascii_lowercase();

        assert_eq!("PER", first);
        assert_eq!(" martin-löf", last);
    }

    assert_eq!("PER martin-löf", s)
}

@bungcip bungcip deleted the fix-doc-1 branch April 15, 2016 11:44
@GuillaumeGomez
Copy link
Member

Since you're writing examples displayed only on nightly for the moment, it doesn't matter. :p

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.

6 participants