Refactor and Optimization of Match Resource Definition #3649
+293
−124
Annotations
2 errors and 1 warning
|
actix-router/src/resource.rs#L701
[clippy] reported by reviewdog 🐶
error: unneeded `return` statement
--> actix-router/src/resource.rs:701:25
|
701 | None => return None,
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `-D clippy::needless-return` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_return)]`
help: remove `return`
|
701 - None => return None,
701 + None => None,
|
Raw Output:
actix-router/src/resource.rs:701:25:e:error: unneeded `return` statement
--> actix-router/src/resource.rs:701:25
|
701 | None => return None,
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `-D clippy::needless-return` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_return)]`
help: remove `return`
|
701 - None => return None,
701 + None => None,
|
__END__
|
|
actix-router/src/resource.rs#L251
[clippy] reported by reviewdog 🐶
error: large size difference between variants
--> actix-router/src/resource.rs:251:1
|
251 | / pub enum ResourceMatchInfo<'a> {
252 | | / Static {
253 | | | matched_len: u16,
254 | | | },
| | |_____- the second-largest variant contains at least 2 bytes
255 | | / Dynamic {
256 | | | matched_len: u16,
257 | | | matched_vars: &'a [&'static str],
258 | | | segments: [PathItem; MAX_DYNAMIC_SEGMENTS],
259 | | | },
| | |_____- the largest variant contains at least 402 bytes
260 | | }
| |___^ the entire enum is at least 408 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
= note: `-D clippy::large-enum-variant` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::large_enum_variant)]`
help: consider boxing the large fields to reduce the total size of the enum
|
258 - segments: [PathItem; MAX_DYNAMIC_SEGMENTS],
258 + segments: Box<[PathItem; MAX_DYNAMIC_SEGMENTS]>,
|
Raw Output:
actix-router/src/resource.rs:251:1:e:error: large size difference between variants
--> actix-router/src/resource.rs:251:1
|
251 | / pub enum ResourceMatchInfo<'a> {
252 | | / Static {
253 | | | matched_len: u16,
254 | | | },
| | |_____- the second-largest variant contains at least 2 bytes
255 | | / Dynamic {
256 | | | matched_len: u16,
257 | | | matched_vars: &'a [&'static str],
258 | | | segments: [PathItem; MAX_DYNAMIC_SEGMENTS],
259 | | | },
| | |_____- the largest variant contains at least 402 bytes
260 | | }
| |___^ the entire enum is at least 408 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
= note: `-D clippy::large-enum-variant` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::large_enum_variant)]`
help: consider boxing the large fields to reduce the total size of the enum
|
258 - segments: [PathItem; MAX_DYNAMIC_SEGMENTS],
258 + segments: Box<[PathItem; MAX_DYNAMIC_SEGMENTS]>,
|
__END__
|
|
|
The logs for this run have expired and are no longer available.
Loading