-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
improve Vec::extends_from_within docs #104777
improve Vec::extends_from_within docs #104777
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
f6b10d0
to
c18461d
Compare
library/alloc/src/vec/mod.rs
Outdated
/// With numbers: | ||
/// | ||
/// ``` | ||
/// let mut vec = vec![0, 1, 2, 3, 4]; | ||
/// let mut numbers1 = vec![0, 1, 2, 3, 4]; | ||
/// numbers1.extend_from_within(2..); | ||
/// assert_eq!(numbers1, [0, 1, 2, 3, 4, 2, 3, 4]); | ||
/// | ||
/// let mut numbers2 = vec![0, 1, 2, 3, 4]; | ||
/// numbers2.extend_from_within(..2); | ||
/// assert_eq!(numbers2, [0, 1, 2, 3, 4, 0, 1]); | ||
/// | ||
/// vec.extend_from_within(2..); | ||
/// assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4]); | ||
/// let mut numbers3 = vec![0, 1, 2, 3, 4]; | ||
/// numbers3.extend_from_within(1..3); | ||
/// assert_eq!(numbers3, [0, 1, 2, 3, 4, 1, 2]); |
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.
If the goal is to prevent confusion between the indices and values then this section can just be replaced, no need to keep it.
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.
done thx
r? @scottmcm |
Improves the documentation for the extends_from_within function for VEC
Fixes #104762