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

doc(str): show example of chars().count() under len() #66038

Merged
merged 1 commit into from
Nov 5, 2019

Conversation

jdx
Copy link
Contributor

@jdx jdx commented Nov 2, 2019

the docs are great at explaining that .len() isn't like in other
languages but stops short of explaining how to get the character length.

@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 @alexcrichton (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 Nov 2, 2019
@jdx jdx force-pushed the char-len branch 2 times, most recently from e94b6d5 to e83533e Compare November 2, 2019 03:13
the docs are great at explaining that .len() isn't like in other
languages but stops short of explaining how to get the character length.

r? @steveklabnik
@@ -2085,8 +2085,8 @@ impl str {
/// let len = "foo".len();
/// assert_eq!(3, len);
///
/// let len = "ƒoo".len(); // fancy f!
/// assert_eq!(4, len);
/// assert_eq!("ƒoo".len(), 4); // fancy f!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

is the rust convention to do assert_eq!(expected, actual)? or assert_eq!(actual, expected)?

it looks like String is doing one but str is doing the other

@alexcrichton
Copy link
Member

@bors: r+

Looks great, thanks!

I don't think we have a super strong convention for the ordering of assert_eq!, so what's there is fine

@bors
Copy link
Contributor

bors commented Nov 4, 2019

📌 Commit d9ec5fa 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 Nov 4, 2019
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Nov 5, 2019
doc(str): show example of chars().count() under len()

the docs are great at explaining that .len() isn't like in other
languages but stops short of explaining how to get the character length.
bors added a commit that referenced this pull request Nov 5, 2019
Rollup of 10 pull requests

Successful merges:

 - #65136 (Update codegen option documentation.)
 - #65574 (docs: improve disclaimer regarding LinkedList)
 - #65720 (Add FFI bindings for LLVM's Module::getInstructionCount())
 - #65905 ([doc] fixes for unix/vxworks `OpenOptionsExt::mode`)
 - #65962 (Fix logic in example.)
 - #66019 (Improved std::iter::Chain documentation)
 - #66038 (doc(str): show example of chars().count() under len())
 - #66042 (Suggest correct code when encountering an incorrect trait bound referencing the current trait)
 - #66073 (Do not needlessly write-lock)
 - #66096 (Add a failing UI test for multiple loops of all kinds in a `const`)

Failed merges:

r? @ghost
@bors bors merged commit d9ec5fa into rust-lang:master Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants