Skip to content

add rate-limit feature and http-rate crate. #869

add rate-limit feature and http-rate crate.

add rate-limit feature and http-rate crate. #869

Triggered via pull request January 19, 2024 02:34
Status Success
Total duration 41s
Artifacts
This run and associated checks have been archived and are scheduled for deletion. Learn more about checks retention

miri.yml

on: pull_request
Fit to window
Zoom out
Zoom in

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#L79
warning: useless conversion to the same type: `std::str::Split<'_, char>` --> http-rate/src/lib.rs:79:20 | 79 | .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#L79
warning: called `map(..).flatten()` on `Iterator` --> http-rate/src/lib.rs:79:47 | 79 | .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#L79
warning: called `map(..).flatten()` on `Iterator` --> http-rate/src/lib.rs:79:10 | 79 | .map(|val| val.split(';').into_iter().map(|p| p.split(',')).flatten()) | __________^ 80 | | .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#L56
warning: a `const` item should never be interior mutable --> http-rate/src/lib.rs:56:1 | 56 | 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#L55
warning: a `const` item should never be interior mutable --> http-rate/src/lib.rs:55:1 | 55 | 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#L77
warning: single-character string constant used as pattern --> http-rate/src/error.rs:77:39 | 77 | 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#L75
warning: single-character string constant used as pattern --> http-rate/src/error.rs:75:41 | 75 | 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#L79
warning: useless conversion to the same type: `std::str::Split<'_, char>` --> http-rate/src/lib.rs:79:20 | 79 | .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#L79
warning: called `map(..).flatten()` on `Iterator` --> http-rate/src/lib.rs:79:47 | 79 | .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#L79
warning: called `map(..).flatten()` on `Iterator` --> http-rate/src/lib.rs:79:10 | 79 | .map(|val| val.split(';').into_iter().map(|p| p.split(',')).flatten()) | __________^ 80 | | .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#L56
warning: a `const` item should never be interior mutable --> http-rate/src/lib.rs:56:1 | 56 | 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#L55
warning: a `const` item should never be interior mutable --> http-rate/src/lib.rs:55:1 | 55 | 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