From 492318389cd1f758bf087b59a89bc31f8e9f0a74 Mon Sep 17 00:00:00 2001 From: Vighnesh Maheshwari Date: Tue, 3 Dec 2024 16:56:22 +0000 Subject: [PATCH 1/2] chore(cargo-deny): update license exceptions list --- deny.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deny.toml b/deny.toml index d2fdff6..d7df310 100644 --- a/deny.toml +++ b/deny.toml @@ -20,7 +20,7 @@ allow = [ exceptions = [ { name = "generational-arena", allow = ["MPL-2.0"] }, - { name = "unicode-ident", allow = ["MIT", "Apache-2.0", "Unicode-DFS-2016"] }, + { name = "unicode-ident", allow = ["MIT", "Apache-2.0", "Unicode-3.0"] }, { name = "icu_collections", allow = ["Unicode-3.0"] }, { name = "icu_locid", allow = ["Unicode-3.0"] }, { name = "icu_locid_transform", allow = ["Unicode-3.0"] }, From d072a70ec6cc8093b2f6d6c7d2d15621ae1da55f Mon Sep 17 00:00:00 2001 From: Vighnesh Maheshwari Date: Tue, 3 Dec 2024 17:57:24 +0000 Subject: [PATCH 2/2] chore: fix clippy warnings --- .../modeled-types/src/kubernetes.rs | 2 +- bottlerocket-settings-models/scalar-derive/src/lib.rs | 4 ++-- bottlerocket-settings-plugin/src/settings.rs | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bottlerocket-settings-models/modeled-types/src/kubernetes.rs b/bottlerocket-settings-models/modeled-types/src/kubernetes.rs index 1724eb0..338309b 100644 --- a/bottlerocket-settings-models/modeled-types/src/kubernetes.rs +++ b/bottlerocket-settings-models/modeled-types/src/kubernetes.rs @@ -669,7 +669,7 @@ mod test_reserved_resources_key { } } -/// // =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= +// =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= /// KubernetesQuantityValue represents a string that contains a valid kubernetes quantity value. /// https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ diff --git a/bottlerocket-settings-models/scalar-derive/src/lib.rs b/bottlerocket-settings-models/scalar-derive/src/lib.rs index bccd986..4a5e3ec 100644 --- a/bottlerocket-settings-models/scalar-derive/src/lib.rs +++ b/bottlerocket-settings-models/scalar-derive/src/lib.rs @@ -539,7 +539,7 @@ fn find_inner_field(data_struct: DataStruct, field_name: Option<&str>) -> (Strin } Fields::Unnamed(unnamed_field) => { let field_name = field_name.unwrap_or("0"); - return ( + ( field_name.to_string(), typename( &unnamed_field @@ -551,7 +551,7 @@ fn find_inner_field(data_struct: DataStruct, field_name: Option<&str>) -> (Strin ) .ty, ), - ); + ) } Fields::Unit => { panic!( diff --git a/bottlerocket-settings-plugin/src/settings.rs b/bottlerocket-settings-plugin/src/settings.rs index 64162bb..ef197e6 100644 --- a/bottlerocket-settings-plugin/src/settings.rs +++ b/bottlerocket-settings-plugin/src/settings.rs @@ -3,12 +3,14 @@ This crate defines the FFI specification for Bottlerocket settings plugins, as w functions. */ -// Avoid empty doc comment warning that originates from the StableAbi derive macro. -#![allow(clippy::empty_docs)] // Avoid false positive improper ctypes warnings for abi_stable's PhantomData markers. We rely on // the StableAbi trait to catch any real problems. -#![allow(improper_ctypes_definitions)] - +#![expect(improper_ctypes_definitions)] +// Avoid warning thrown by StableAbi's definition of non-local `impl` +#![expect(non_local_definitions)] +// Avoid `elide the lifetimes` warnings by clippy. The suggested changes do not make the code more +// readable +#![expect(clippy::needless_lifetimes)] use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde_json::Value as JsonValue; use std::path::PathBuf;