Skip to content

chore: remove unneeded lifetimes #1180

chore: remove unneeded lifetimes

chore: remove unneeded lifetimes #1180

Triggered via push February 19, 2025 15:25
Status Failure
Total duration 1m 55s
Artifacts

lint.yml

on: push
Fit to window
Zoom out
Zoom in

Annotations

10 errors
unexpected `cfg` condition name: `staging`: data-plane/src/lib.rs#L97
error: unexpected `cfg` condition name: `staging` --> data-plane/src/lib.rs:97:11 | 97 | #[cfg(staging)] | ^^^^^^^ | = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows` = help: consider using a Cargo feature instead = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(staging)'] } = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(staging)");` to the top of the `build.rs` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration = note: `-D unexpected-cfgs` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unexpected_cfgs)]`
unexpected `cfg` condition name: `staging`: data-plane/src/lib.rs#L102
error: unexpected `cfg` condition name: `staging` --> data-plane/src/lib.rs:102:11 | 102 | #[cfg(staging)] | ^^^^^^^ | = help: consider using a Cargo feature instead = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(staging)'] } = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(staging)");` to the top of the `build.rs` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
unexpected `cfg` condition name: `staging`: data-plane/src/lib.rs#L109
error: unexpected `cfg` condition name: `staging` --> data-plane/src/lib.rs:109:15 | 109 | #[cfg(not(staging))] | ^^^^^^^ | = help: consider using a Cargo feature instead = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(staging)'] } = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(staging)");` to the top of the `build.rs` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
unexpected `cfg` condition name: `staging`: data-plane/src/lib.rs#L114
error: unexpected `cfg` condition name: `staging` --> data-plane/src/lib.rs:114:15 | 114 | #[cfg(not(staging))] | ^^^^^^^ | = help: consider using a Cargo feature instead = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(staging)'] } = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(staging)");` to the top of the `build.rs` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
unexpected `cfg` condition name: `staging`: data-plane/src/lib.rs#L121
error: unexpected `cfg` condition name: `staging` --> data-plane/src/lib.rs:121:19 | 121 | #[cfg(not(staging))] | ^^^^^^^ | = help: consider using a Cargo feature instead = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(staging)'] } = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(staging)");` to the top of the `build.rs` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
unexpected `cfg` condition name: `staging`: data-plane/src/lib.rs#L124
error: unexpected `cfg` condition name: `staging` --> data-plane/src/lib.rs:124:15 | 124 | #[cfg(staging)] | ^^^^^^^ | = help: consider using a Cargo feature instead = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint: [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(staging)'] } = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(staging)");` to the top of the `build.rs` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
unneeded `return` statement: data-plane/src/crypto/stream.rs#L86
error: unneeded `return` statement --> data-plane/src/crypto/stream.rs:86:9 | 86 | / return match parser::parse_ciphertexts(potential_ciphertext) { 87 | | Ok((_, Some(mut ciphertext))) => { 88 | | ciphertext.set_leading_quote(quote_precedes_cipher); 89 | | src.advance(ciphertext.len()); ... | 113 | | Err(nom::Err::Failure(_)) => Err(IncomingStreamError::NomFailure), 114 | | }; | |_________^ | = 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` | 86 ~ match parser::parse_ciphertexts(potential_ciphertext) { 87 + Ok((_, Some(mut ciphertext))) => { 88 + ciphertext.set_leading_quote(quote_precedes_cipher); 89 + src.advance(ciphertext.len()); 90 + let ciphertext_start = self.offset; 91 + self.offset += ciphertext.len(); 92 + Ok(Some(IncomingFrame::Ciphertext(( 93 + (ciphertext_start, self.offset), 94 + ciphertext, 95 + )))) 96 + } 97 + Ok((input, None)) => { 98 + let next_candidate = Self::find_next_ciphertext_candidate(&input[3..])?; 99 + if let Some((_, prefix)) = next_candidate { 100 + let prefix_len = prefix.len(); 101 + let plaintext_bytes = self.create_slice(src, prefix_len + 3); 102 + Ok(Some(IncomingFrame::Plaintext(plaintext_bytes.to_vec()))) 103 + } else { 104 + let entire_buffer = self.create_slice(src, src.len()); 105 + Ok(Some(IncomingFrame::Plaintext(entire_buffer.to_vec()))) 106 + } 107 + } 108 + Err(nom::Err::Incomplete(nom::Needed::Size(known_size))) => { 109 + Err(IncomingStreamError::Incomplete(Some(known_size.get()))) 110 + } 111 + Err(nom::Err::Incomplete(_)) => Err(IncomingStreamError::Incomplete(None)), 112 + Err(nom::Err::Error(_)) => Err(IncomingStreamError::NomError), 113 + Err(nom::Err::Failure(_)) => Err(IncomingStreamError::NomFailure), 114 ~ } |
this `map_or` is redundant: data-plane/src/server/tls/cert_resolver.rs#L132
error: this `map_or` is redundant --> data-plane/src/server/tls/cert_resolver.rs:132:33 | 132 | Some(servername) => servername | _________________________________^ 133 | | .split('.') 134 | | .rev() 135 | | .nth(2) 136 | | .map_or(false, |subdomain| ["cage", "enclave"].contains(&subdomain)), | |____________________________________________________________________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or = note: `-D clippy::unnecessary-map-or` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::unnecessary_map_or)]` help: use is_some_and instead | 132 ~ Some(servername) => servername 133 + .split('.') 134 + .rev() 135 ~ .nth(2).is_some_and(|subdomain| ["cage", "enclave"].contains(&subdomain)), |
using `map_err` over `inspect_err`: data-plane/src/server/tls/cert_resolver.rs#L309
error: using `map_err` over `inspect_err` --> data-plane/src/server/tls/cert_resolver.rs:309:14 | 309 | .map_err(|err| { | ^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect = note: `-D clippy::manual-inspect` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::manual_inspect)]` help: try | 309 ~ .inspect_err(|err| { 310 ~ log::error!("An error occurred while generating the self signed cert"); |
clippy_check
Clippy has exited with exit code 101