add rate-limit feature and http-rate crate. #870
This run and associated checks have been archived and are scheduled for deletion.
Learn more about checks retention
Annotations
25 warnings
miri
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
miri
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
miri
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
miri
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
miri
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
using `clone` on type `Quota` which implements the `Copy` trait:
web/src/middleware/rate_limit.rs#L52
warning: using `clone` on type `Quota` which implements the `Copy` trait
--> web/src/middleware/rate_limit.rs:52:51
|
52 | rate_limit: http_rate::RateLimit::new(self.0.clone()),
| ^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.0`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
|
useless conversion to the same type: `std::str::Split<'_, char>`:
http-rate/src/lib.rs#L75
warning: useless conversion to the same type: `std::str::Split<'_, char>`
--> http-rate/src/lib.rs:75:20
|
75 | .map(|val| val.split(';').into_iter().map(|p| p.split(',')).flatten())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `val.split(';')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
called `map(..).flatten()` on `Iterator`:
http-rate/src/lib.rs#L75
warning: called `map(..).flatten()` on `Iterator`
--> http-rate/src/lib.rs:75:47
|
75 | .map(|val| val.split(';').into_iter().map(|p| p.split(',')).flatten())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|p| p.split(','))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
|
called `map(..).flatten()` on `Iterator`:
http-rate/src/lib.rs#L75
warning: called `map(..).flatten()` on `Iterator`
--> http-rate/src/lib.rs:75:10
|
75 | .map(|val| val.split(';').into_iter().map(|p| p.split(',')).flatten())
| __________^
76 | | .flatten()
| |__________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|val| val.split(';').into_iter().map(|p| p.split(',')).flatten())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
|
a `const` item should never be interior mutable:
http-rate/src/lib.rs#L52
warning: a `const` item should never be interior mutable
--> http-rate/src/lib.rs:52:1
|
52 | const X_FORWARDED_FOR: HeaderName = HeaderName::from_static("x-forwarded-for");
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| make this a static item (maybe with lazy_static)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
|
a `const` item should never be interior mutable:
http-rate/src/lib.rs#L51
warning: a `const` item should never be interior mutable
--> http-rate/src/lib.rs:51:1
|
51 | const X_REAL_IP: HeaderName = HeaderName::from_static("x-real-ip");
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| make this a static item (maybe with lazy_static)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
|
a `const` item should never be interior mutable:
http-rate/src/snapshot.rs#L24
warning: a `const` item should never be interior mutable
--> http-rate/src/snapshot.rs:24:1
|
24 | const X_RT_REMAINING: HeaderName = HeaderName::from_static("x-ratelimit-remaining");
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| make this a static item (maybe with lazy_static)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
|
a `const` item should never be interior mutable:
http-rate/src/snapshot.rs#L23
warning: a `const` item should never be interior mutable
--> http-rate/src/snapshot.rs:23:1
|
23 | const X_RT_LIMIT: HeaderName = HeaderName::from_static("x-ratelimit-limit");
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| make this a static item (maybe with lazy_static)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
|
single-character string constant used as pattern:
http-rate/src/error.rs#L73
warning: single-character string constant used as pattern
--> http-rate/src/error.rs:73:39
|
73 | assert!(debug_output.contains("3"));
| ^^^ help: try using a `char` instead: `'3'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
|
single-character string constant used as pattern:
http-rate/src/error.rs#L71
warning: single-character string constant used as pattern
--> http-rate/src/error.rs:71:41
|
71 | assert!(display_output.contains("3"));
| ^^^ help: try using a `char` instead: `'3'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
= note: `#[warn(clippy::single_char_pattern)]` on by default
|
a `const` item should never be interior mutable:
http-rate/src/error.rs#L34
warning: a `const` item should never be interior mutable
--> http-rate/src/error.rs:34:1
|
34 | const X_RT_AFTER: HeaderName = HeaderName::from_static("x-ratelimit-after");
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| make this a static item (maybe with lazy_static)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
= note: `#[warn(clippy::declare_interior_mutable_const)]` on by default
|
using `clone` on type `Quota` which implements the `Copy` trait:
web/src/middleware/rate_limit.rs#L52
warning: using `clone` on type `Quota` which implements the `Copy` trait
--> web/src/middleware/rate_limit.rs:52:51
|
52 | rate_limit: http_rate::RateLimit::new(self.0.clone()),
| ^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.0`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
|
useless conversion to the same type: `std::str::Split<'_, char>`:
http-rate/src/lib.rs#L75
warning: useless conversion to the same type: `std::str::Split<'_, char>`
--> http-rate/src/lib.rs:75:20
|
75 | .map(|val| val.split(';').into_iter().map(|p| p.split(',')).flatten())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `val.split(';')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
called `map(..).flatten()` on `Iterator`:
http-rate/src/lib.rs#L75
warning: called `map(..).flatten()` on `Iterator`
--> http-rate/src/lib.rs:75:47
|
75 | .map(|val| val.split(';').into_iter().map(|p| p.split(',')).flatten())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|p| p.split(','))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
|
called `map(..).flatten()` on `Iterator`:
http-rate/src/lib.rs#L75
warning: called `map(..).flatten()` on `Iterator`
--> http-rate/src/lib.rs:75:10
|
75 | .map(|val| val.split(';').into_iter().map(|p| p.split(',')).flatten())
| __________^
76 | | .flatten()
| |__________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|val| val.split(';').into_iter().map(|p| p.split(',')).flatten())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
|
a `const` item should never be interior mutable:
http-rate/src/lib.rs#L52
warning: a `const` item should never be interior mutable
--> http-rate/src/lib.rs:52:1
|
52 | const X_FORWARDED_FOR: HeaderName = HeaderName::from_static("x-forwarded-for");
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| make this a static item (maybe with lazy_static)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
|
a `const` item should never be interior mutable:
http-rate/src/lib.rs#L51
warning: a `const` item should never be interior mutable
--> http-rate/src/lib.rs:51:1
|
51 | const X_REAL_IP: HeaderName = HeaderName::from_static("x-real-ip");
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| make this a static item (maybe with lazy_static)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
|
a `const` item should never be interior mutable:
http-rate/src/snapshot.rs#L24
warning: a `const` item should never be interior mutable
--> http-rate/src/snapshot.rs:24:1
|
24 | const X_RT_REMAINING: HeaderName = HeaderName::from_static("x-ratelimit-remaining");
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| make this a static item (maybe with lazy_static)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
|
a `const` item should never be interior mutable:
http-rate/src/snapshot.rs#L23
warning: a `const` item should never be interior mutable
--> http-rate/src/snapshot.rs:23:1
|
23 | const X_RT_LIMIT: HeaderName = HeaderName::from_static("x-ratelimit-limit");
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| make this a static item (maybe with lazy_static)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
|
a `const` item should never be interior mutable:
http-rate/src/error.rs#L34
warning: a `const` item should never be interior mutable
--> http-rate/src/error.rs:34:1
|
34 | const X_RT_AFTER: HeaderName = HeaderName::from_static("x-ratelimit-after");
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| make this a static item (maybe with lazy_static)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
= note: `#[warn(clippy::declare_interior_mutable_const)]` on by default
|