Skip to content

Commit

Permalink
Fix latest clippy lints (#568)
Browse files Browse the repository at this point in the history
* Fix latest clippy lints

* Another fix

* Fix (more) latest clippy lints

* Put large array on heap
  • Loading branch information
justsmth authored Nov 5, 2024
1 parent 05f8a25 commit 314d12b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions aws-lc-fips-sys/builder/cmake_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ impl CmakeBuilder {
cmake::Config::new(&self.manifest_dir)
}

#[allow(clippy::too_many_lines)]
fn prepare_cmake_build(&self) -> cmake::Config {
let mut cmake_cfg = self.get_cmake_config();

Expand Down
4 changes: 2 additions & 2 deletions aws-lc-fips-sys/builder/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ fn prepare_cargo_cfg() {
}

bindgen_available!(
fn handle_bindgen(manifest_dir: &PathBuf, prefix: &Option<String>) -> bool {
fn handle_bindgen(manifest_dir: &Path, prefix: &Option<String>) -> bool {
if internal_bindgen_supported() && !is_external_bindgen() {
emit_warning(&format!(
"Generating bindings - internal bindgen. Platform: {}",
Expand All @@ -399,7 +399,7 @@ bindgen_available!(

bindgen_available!(
not,
fn handle_bindgen(_manifest_dir: &PathBuf, _prefix: &Option<String>) -> bool {
fn handle_bindgen(_manifest_dir: &Path, _prefix: &Option<String>) -> bool {
false
}
);
Expand Down
1 change: 1 addition & 0 deletions aws-lc-rs/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ impl Error for KeyRejected {
}

impl Error for Unspecified {
#[allow(clippy::unnecessary_literal_bound)]
fn description(&self) -> &str {
"Unspecified"
}
Expand Down
2 changes: 1 addition & 1 deletion aws-lc-rs/tests/aead_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ fn test_aead<Seal, Open>(
// Debug builds are too slow for this, so for those builds, only
// test a smaller subset.

let mut more_comprehensive_in_prefix_lengths = [0; 4096];
let mut more_comprehensive_in_prefix_lengths = vec![0; 4096].into_boxed_slice();
let in_prefix_lengths = if cfg!(debug_assertions) {
&MINIMAL_IN_PREFIX_LENS[..]
} else {
Expand Down
2 changes: 1 addition & 1 deletion aws-lc-sys/builder/cc_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ impl crate::Builder for CcBuilder {
Ok(())
}

fn name(&self) -> &str {
fn name(&self) -> &'static str {
"CC"
}
}
3 changes: 2 additions & 1 deletion aws-lc-sys/builder/cmake_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ impl CmakeBuilder {
cmake_cfg
}

#[allow(clippy::unused_self)]
fn configure_android(&self, _cmake_cfg: &mut cmake::Config) {
// If we leave CMAKE_SYSTEM_PROCESSOR unset, then cmake-rs should handle properly setting
// CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_PROCESSOR:
Expand Down Expand Up @@ -399,7 +400,7 @@ impl crate::Builder for CmakeBuilder {
Ok(())
}

fn name(&self) -> &str {
fn name(&self) -> &'static str {
"CMake"
}
}
4 changes: 2 additions & 2 deletions aws-lc-sys/builder/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ fn is_crt_static() -> bool {
}

bindgen_available!(
fn handle_bindgen(manifest_dir: &PathBuf, prefix: &Option<String>) -> bool {
fn handle_bindgen(manifest_dir: &Path, prefix: &Option<String>) -> bool {
if internal_bindgen_supported() && !is_external_bindgen() {
emit_warning(&format!(
"Generating bindings - internal bindgen. Platform: {}",
Expand All @@ -504,7 +504,7 @@ bindgen_available!(

bindgen_available!(
not,
fn handle_bindgen(_manifest_dir: &PathBuf, _prefix: &Option<String>) -> bool {
fn handle_bindgen(_manifest_dir: &Path, _prefix: &Option<String>) -> bool {
false
}
);
Expand Down

0 comments on commit 314d12b

Please sign in to comment.