-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add a doctest for the btreemap's entry method. #20134
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 a doctest for the btreemap's entry method. #20134
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
/// }, | ||
/// } | ||
/// } | ||
/// ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an assert for e.g. the count of "a"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gankro Is it appropriate to do something as simple as:
assert_eq!(*count.get("a").unwrap(), 3u);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to even do:
assert_eq!(count["a"], 3);
Make some updates to the entry doctest.
ee7701a
to
e8fcbfb
Compare
Thanks for the feedback! Updated. |
/// } | ||
/// } | ||
/// | ||
/// assert_eq!(count["a"], 3u); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either this u
can be omitted, or the whole type of count
can-- I think. Your call.
Oh heh, should've refreshed the whole PR. No worries, not actually a big deal. :) Thanks! |
…entry This is an updated version of rust-lang#19711. The merge and subsequent rebase on that branch were more trouble than they were worth, so I am just resubmitting the relevant change here. If this PR is accepted, then rust-lang#19711 can be closed. /cc @gankro
This is an updated version of #19711. The merge and subsequent rebase on that branch were more trouble than they were worth, so I am just resubmitting the relevant change here.
If this PR is accepted, then #19711 can be closed.
/cc @gankro