Skip to content

Commit

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

* Fix rustfmt
  • Loading branch information
justsmth authored Nov 19, 2024
1 parent 697e755 commit bee27e4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion aws-lc-fips-sys/builder/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ fn setup_include_paths(out_dir: &Path, manifest_dir: &Path) -> PathBuf {
// iterate over all the include paths and copy them into the final output
for path in include_paths {
for child in std::fs::read_dir(path).into_iter().flatten().flatten() {
if child.file_type().map_or(false, |t| t.is_file()) {
if child.file_type().is_ok_and(|t| t.is_file()) {
let _ = std::fs::copy(
child.path(),
include_dir.join(child.path().file_name().unwrap()),
Expand Down
8 changes: 4 additions & 4 deletions aws-lc-rs/src/cipher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ impl EncryptingKey {
}

/// Constructs an `EncryptingKey` operating in electronic code book mode (ECB) using the provided key.
///
///
/// # ☠️ ️️️DANGER ☠️
/// Offered for computability purposes only. This is an extremely dangerous mode, and
/// very likely not what you want to use.
Expand Down Expand Up @@ -571,7 +571,7 @@ impl EncryptingKey {
/// Encrypts the data provided in `in_out` in-place.
/// Returns a [`DecryptionContext`] with the randomly generated IV that was used to encrypt
/// the data provided.
///
///
/// If `EncryptingKey` is operating in `OperatingMode::ECB`, then `in_out.len()` must be a multiple
/// of the block length.
///
Expand All @@ -587,7 +587,7 @@ impl EncryptingKey {
/// This is considered "less safe" because the caller could potentially construct
/// a `EncryptionContext` from a previously used IV (initialization vector).
/// Returns a [`DecryptionContext`] produced from the provided `EncryptionContext`.
///
///
/// If `EncryptingKey` is operating in `OperatingMode::ECB`, then `in_out.len()` must be a multiple
/// of the block length.
///
Expand Down Expand Up @@ -694,7 +694,7 @@ impl DecryptingKey {

/// Decrypts the data provided in `in_out` in-place.
/// Returns a references to the decrypted data.
///
///
/// If `DecryptingKey` is operating in `OperatingMode::ECB`, then `in_out.len()` must be a multiple
/// of the block length.
///
Expand Down
4 changes: 2 additions & 2 deletions aws-lc-rs/src/cipher/padded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl PaddedBlockEncryptingKey {

/// Constructs a new `PaddedBlockEncryptingKey` cipher with electronic code book (ECB) mode.
/// Plaintext data is padded following the PKCS#7 scheme.
///
///
/// # ☠️ ️️️DANGER ☠️
/// Offered for computability purposes only. This is an extremely dangerous mode, and
/// very likely not what you want to use.
Expand Down Expand Up @@ -210,7 +210,7 @@ impl PaddedBlockDecryptingKey {

/// Constructs a new `PaddedBlockDecryptingKey` cipher with electronic code book (ECB) mode.
/// Decrypted data is unpadded following the PKCS#7 scheme.
///
///
/// # ☠️ ️️️DANGER ☠️
/// Offered for computability purposes only. This is an extremely dangerous mode, and
/// very likely not what you want to use.
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 @@ -219,7 +219,7 @@ impl CcBuilder {
let source_path = self.manifest_dir.join("aws-lc").join(source);
let is_asm = std::path::Path::new(source)
.extension()
.map_or(false, |ext| ext.eq("S"));
.is_some_and(|ext| ext.eq("S"));
if is_asm && target_vendor() == "apple" && target_arch() == "aarch64" {
let mut cc_preprocessor = self.create_builder();
cc_preprocessor.file(source_path);
Expand Down
2 changes: 1 addition & 1 deletion aws-lc-sys/builder/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ fn setup_include_paths(out_dir: &Path, manifest_dir: &Path) -> PathBuf {
// iterate over all the include paths and copy them into the final output
for path in include_paths {
for child in std::fs::read_dir(path).into_iter().flatten().flatten() {
if child.file_type().map_or(false, |t| t.is_file()) {
if child.file_type().is_ok_and(|t| t.is_file()) {
let _ = std::fs::copy(
child.path(),
include_dir.join(child.path().file_name().unwrap()),
Expand Down

0 comments on commit bee27e4

Please sign in to comment.