chore: prepare 1.0 release #56
clippy
18 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 18 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.78.0-nightly (ef324565d 2024-02-27)
- cargo 1.78.0-nightly (194a60b29 2024-02-21)
- clippy 0.1.78 (ef32456 2024-02-27)
Annotations
Check warning on line 224 in ntex-files/src/lib.rs
github-actions / clippy
needless `fn main` in doctest
warning: needless `fn main` in doctest
--> ntex-files/src/lib.rs:218:5
|
218 | /// use ntex::web::App;
| _____^
219 | | /// use ntex_files as fs;
220 | | ///
221 | | /// fn main() {
222 | | /// let app = App::new()
223 | | /// .service(fs::Files::new("/static", "."));
224 | | /// }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
= note: `#[warn(clippy::needless_doctest_main)]` on by default
Check warning on line 16 in ntex-files/src/range.rs
github-actions / clippy
this returns a `Result<_, ()>`
warning: this returns a `Result<_, ()>`
--> ntex-files/src/range.rs:16:5
|
16 | pub fn parse(header: &str, size: u64) -> Result<Vec<HttpRange>, ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use a custom `Error` type instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
= note: `#[warn(clippy::result_unit_err)]` on by default
Check warning on line 38 in ntex-files/src/file_header/parsing.rs
github-actions / clippy
this call to `as_ref` does nothing
warning: this call to `as_ref` does nothing
--> ntex-files/src/file_header/parsing.rs:38:32
|
38 | let s = str::from_utf8(s.as_ref())?;
| ^^^^^^^^^^ help: try: `s`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
= note: `#[warn(clippy::useless_asref)]` on by default
Check warning on line 148 in ntex-files/src/file_header/method.rs
github-actions / clippy
this `impl` can be derived
warning: this `impl` can be derived
--> ntex-files/src/file_header/method.rs:144:1
|
144 | / impl Default for Method {
145 | | fn default() -> Method {
146 | | Method::Get
147 | | }
148 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it...
|
17 + #[derive(Default)]
18 | pub enum Method {
|
help: ...and mark the default variant
|
21 ~ #[default]
22 ~ Get,
|
Check warning on line 125 in ntex-files/src/file_header/entity.rs
github-actions / clippy
redundant slicing of the whole range
warning: redundant slicing of the whole range
--> ntex-files/src/file_header/entity.rs:125:21
|
125 | let slice = &s[..];
| ^^^^^^ help: use the original value instead: `s`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing
= note: `#[warn(clippy::redundant_slicing)]` on by default
Check warning on line 52 in ntex-files/src/error.rs
github-actions / clippy
all variants have the same prefix: `Bad`
warning: all variants have the same prefix: `Bad`
--> ntex-files/src/error.rs:42:1
|
42 | / pub enum UriSegmentError {
43 | | /// The segment started with the wrapped invalid character.
44 | | #[display(fmt = "The segment started with the wrapped invalid character")]
45 | | BadStart(char),
... |
51 | | BadEnd(char),
52 | | }
| |_^
|
= help: remove the prefixes and use full paths to the variants instead of glob imports
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
= note: `#[warn(clippy::enum_variant_names)]` on by default
Check warning on line 66 in ntex-files/src/file_header/mod.rs
github-actions / clippy
method `clone_box` is never used
warning: method `clone_box` is never used
--> ntex-files/src/file_header/mod.rs:66:12
|
65 | pub trait HeaderClone {
| ----------- method in this trait
66 | fn clone_box(&self) -> Box<dyn Header + Send + Sync>;
| ^^^^^^^^^
Check warning on line 12 in ntex-files/src/file_header/raw.rs
github-actions / clippy
method `len` is never used
warning: method `len` is never used
--> ntex-files/src/file_header/raw.rs:12:8
|
7 | pub trait RawLike<'a> {
| ------- method in this trait
...
12 | fn len(&'a self) -> usize;
| ^^^
Check warning on line 92 in ntex-files/src/file_header/error.rs
github-actions / clippy
trait `AssertSendSync` is never used
warning: trait `AssertSendSync` is never used
--> ntex-files/src/file_header/error.rs:92:7
|
92 | trait AssertSendSync: Send + Sync + 'static {}
| ^^^^^^^^^^^^^^
Check warning on line 63 in ntex-files/src/file_header/entity.rs
github-actions / clippy
associated items `weak`, `tag`, `set_tag`, `strong_ne`, and `weak_ne` are never used
warning: associated items `weak`, `tag`, `set_tag`, `strong_ne`, and `weak_ne` are never used
--> ntex-files/src/file_header/entity.rs:63:12
|
51 | impl EntityTag {
| -------------- associated items in this implementation
...
63 | pub fn weak(tag: String) -> EntityTag {
| ^^^^
...
75 | pub fn tag(&self) -> &str {
| ^^^
...
82 | pub fn set_tag(&mut self, tag: String) {
| ^^^^^^^
...
101 | pub fn strong_ne(&self, other: &EntityTag) -> bool {
| ^^^^^^^^^
...
106 | pub fn weak_ne(&self, other: &EntityTag) -> bool {
| ^^^^^^^
Check warning on line 184 in ntex-files/src/file_header/mod.rs
github-actions / clippy
trait `StandardHeader` is never used
warning: trait `StandardHeader` is never used
--> ntex-files/src/file_header/mod.rs:184:11
|
184 | pub trait StandardHeader: Header + Sized {
| ^^^^^^^^^^^^^^
Check warning on line 126 in ntex-files/src/file_header/mod.rs
github-actions / clippy
method `danger_fmt_line_without_newline_replacer` is never used
warning: method `danger_fmt_line_without_newline_replacer` is never used
--> ntex-files/src/file_header/mod.rs:126:8
|
88 | impl<'a, 'b> Formatter<'a, 'b> {
| ------------------------------ method in this implementation
...
126 | fn danger_fmt_line_without_newline_replacer<T: std::fmt::Display>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 29 in ntex-files/src/file_header/mod.rs
github-actions / clippy
associated items `header_name` and `fmt_header` are never used
warning: associated items `header_name` and `fmt_header` are never used
--> ntex-files/src/file_header/mod.rs:29:8
|
25 | pub trait Header: 'static + HeaderClone + Send + Sync {
| ------ associated items in this trait
...
29 | fn header_name() -> &'static str
| ^^^^^^^^^^^
...
58 | fn fmt_header(&self, f: &mut Formatter) -> std::fmt::Result;
| ^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Check warning on line 184 in ntex-identity/src/lib.rs
github-actions / clippy
methods called `from_*` usually take no `self`
warning: methods called `from_*` usually take no `self`
--> ntex-identity/src/lib.rs:184:21
|
184 | fn from_request(&self, request: &mut WebRequest<Err>) -> Self::Future;
| ^^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
= note: `#[warn(clippy::wrong_self_convention)]` on by default
Check warning on line 212 in ntex-cors/src/lib.rs
github-actions / clippy
explicit call to `.into_iter()` in function argument accepting `IntoIterator`
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> ntex-cors/src/lib.rs:203:17
|
203 | / vec![
204 | | Method::GET,
205 | | Method::HEAD,
206 | | Method::POST,
... |
211 | | ]
212 | | .into_iter(),
| |____________________________^
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
--> /rustc/ef324565d071c6d7e2477a195648549e33d6a465/library/core/src/iter/traits/collect.rs:150:21
= 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
help: consider removing the `.into_iter()`
|
203 ~ vec![
204 + Method::GET,
205 + Method::HEAD,
206 + Method::POST,
207 + Method::OPTIONS,
208 + Method::PUT,
209 + Method::PATCH,
210 + Method::DELETE,
211 ~ ],
|
Check warning on line 223 in ntex-cors/src/lib.rs
github-actions / clippy
method `default` can be confused for the standard trait method `std::default::Default::default`
warning: method `default` can be confused for the standard trait method `std::default::Default::default`
--> ntex-cors/src/lib.rs:198:5
|
198 | / pub fn default<Err>() -> CorsFactory<Err> {
199 | | let inner = Inner {
200 | | origins: AllOrSome::default(),
201 | | origins_str: None,
... |
222 | | CorsFactory { inner: Rc::new(inner), _t: PhantomData }
223 | | }
| |_____^
|
= help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
= note: `#[warn(clippy::should_implement_trait)]` on by default
Check warning on line 119 in ntex-cors/src/lib.rs
github-actions / clippy
this `impl` can be derived
warning: this `impl` can be derived
--> ntex-cors/src/lib.rs:115:1
|
115 | / impl<T> Default for AllOrSome<T> {
116 | | fn default() -> Self {
117 | | AllOrSome::All
118 | | }
119 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it...
|
108 + #[derive(Default)]
109 | pub enum AllOrSome<T> {
|
help: ...and mark the default variant
|
110 ~ #[default]
111 ~ All,
|
Check warning on line 2 in ntex-files/src/file_header/method.rs
github-actions / clippy
the item `AsRef` is imported redundantly
warning: the item `AsRef` is imported redundantly
--> ntex-files/src/file_header/method.rs:2:20
|
2 | use std::convert::{AsRef, TryFrom};
| ^^^^^
--> /rustc/ef324565d071c6d7e2477a195648549e33d6a465/library/std/src/prelude/mod.rs:115:13
|
= note: the item `AsRef` is already defined here
|
= note: `#[warn(unused_imports)]` on by default