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

Add std::vec_ng::Vec::mut_slice_from(), mut_slice_to(), and mut_split_at() #12995

Merged
merged 1 commit into from
Mar 22, 2014

Conversation

Kroisse
Copy link
Contributor

@Kroisse Kroisse commented Mar 18, 2014

These functions are implemented for &mut [T], but std::vec_ng::Vec has not yet.

@@ -474,6 +474,25 @@ impl<T> Vec<T> {
}

#[inline]
pub fn mut_slice_from<'a>(&'a mut self, start: uint) -> &'a mut [T] {
Copy link
Member

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 []).

@sfackler
Copy link
Member

Can you add docs for these? Documentation will be required in this module when #12955 lands.

@thestinger
Copy link
Contributor

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 Vec<T> and slices. Copy-pasting from the slice module to the vector module shouldn't be the solution as it adds needless maintenance burden. If it's done in one place, we won't need a whole duplicate test suite either.

@alexcrichton
Copy link
Member

@Kroisse, this needs a rebase

@Kroisse
Copy link
Contributor Author

Kroisse commented Mar 22, 2014

@alexcrichton I've done

bors added a commit that referenced this pull request Mar 22, 2014
These functions are implemented for &mut [T], but std::vec_ng::Vec has not yet.
@bors bors closed this Mar 22, 2014
@bors bors merged commit 5b03050 into rust-lang:master Mar 22, 2014
@Kroisse Kroisse deleted the vec_ng_mut_slices branch March 23, 2014 03:30
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 27, 2024
…-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.
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