Skip to content

Disable range_minus_one when type is explicity RangeInclusive #4898

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

Closed
rawler opened this issue Dec 12, 2019 · 2 comments
Closed

Disable range_minus_one when type is explicity RangeInclusive #4898

rawler opened this issue Dec 12, 2019 · 2 comments

Comments

@rawler
Copy link

rawler commented Dec 12, 2019

Clippy gives me the hint;

warning: an exclusive range would be more readable
  --> src/main.rs:55:21
   |
55 |         init_range: 0..=(sidx_offset - 1),
   |                     ^^^^^^^^^^^^^^^^^^^^^ help: use: `0..sidx_offset`
   |
   = note: `#[warn(clippy::range_minus_one)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#range_minus_one

However, init_range in the struct in question, is defined as an InclusiveRange. (By design, matching HTTP-Range).

It would be great if clippy could use the type-info from the context to disable inappropriate hints like this.

@rawler
Copy link
Author

rawler commented Dec 12, 2019

Basically, the equivalent of #3307, but for RangeInclusive.

@flip1995
Copy link
Member

Let's track this in #3307

rivy added a commit to rivy/rs.coreutils that referenced this issue Dec 29, 2019
rivy added a commit to rivy/rs.coreutils that referenced this issue Dec 29, 2019
rivy added a commit to rivy/rs.coreutils that referenced this issue Dec 29, 2019
rivy added a commit to rivy/rs.coreutils that referenced this issue Dec 30, 2019
rivy added a commit to rivy/rs.coreutils that referenced this issue Dec 30, 2019
rivy added a commit to rivy/rs.coreutils that referenced this issue Dec 30, 2019
rivy added a commit to rivy/rs.coreutils that referenced this issue Dec 30, 2019
rivy added a commit to rivy/rs.coreutils that referenced this issue Dec 30, 2019
rivy added a commit to rivy/rs.coreutils that referenced this issue Jan 28, 2020
rivy added a commit to rivy/rs.coreutils that referenced this issue Jan 28, 2020
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

No branches or pull requests

2 participants