-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 std::vec_ng::Vec::mut_slice_from(), mut_slice_to(), and mut_split_at() #12995
Conversation
@@ -474,6 +474,25 @@ impl<T> Vec<T> { | |||
} | |||
|
|||
#[inline] | |||
pub fn mut_slice_from<'a>(&'a mut self, start: uint) -> &'a mut [T] { |
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.
These should be implemented as v.as_mut_slice().mut_slice_from(start)
etc (i.e. just reuse the definitions for &mut []
).
Can you add docs for these? Documentation will be required in this module when #12955 lands. |
I think we need to stop duplicating this kind of functionality in both places. It can be refactored so that it's implemented on both |
@Kroisse, this needs a rebase |
@alexcrichton I've done |
These functions are implemented for &mut [T], but std::vec_ng::Vec has not yet.
…-false-positive, r=blyxyas Fix doc_markdown DevOps false positive This fixes an issue where the word "DevOps" ends up as a false positive for the `doc_markdown` lint. In a doc comment like this ```rust /// Call the Azure DevOps REST API. pub fn example() {} ``` the word "DevOps" is highlighted as something which should be in backticks. ``` warning: item in documentation is missing backticks --> src/lib.rs:1:20 | 1 | /// Call the Azure DevOps REST API. | ^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown = note: requested on the command line with `-W clippy::doc-markdown` help: try | 1 | /// Call the Azure `DevOps` REST API. | ~~~~~~~~ warning: `example` (lib) generated 1 warning (run `cargo clippy --fix --lib -p example` to apply 1 suggestion) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.00s ``` This could be overriden with the `doc-valid-idents` configuration parameter as noted by the [documentation](https://rust-lang.github.io/rust-clippy/master/index.html#/doc_markdown), but I believe the word "DevOps" is sufficiently common to belong alongside exceptions like "GitHub" and "GitLab". changelog: [`doc_markdown`]: Fix DevOps false positive.
These functions are implemented for &mut [T], but std::vec_ng::Vec has not yet.