Skip to content

Commit

Permalink
sdk: make changes to fix clippy issues
Browse files Browse the repository at this point in the history
datastore - elide lifetimes where possible
migration_helper - remove empty lines interrupting doc comments
schnauzer - remote empty lines interrupting doc comments
  • Loading branch information
jmt-lab committed Dec 12, 2024
1 parent 1e8b549 commit da22032
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 3 additions & 3 deletions sources/api/datastore/src/serialization/pairs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ fn key_append_or_create(old_prefix: &Option<Key>, key: &Key) -> Result<Key> {
/// separately, whereas we'd prefer a single pass because we only need to store the output. To
/// work around this, we use the Option 'key' in the struct to store the last-serialized key,
/// knowing that serde will serialize keys and values in that order.
impl<'a> ser::SerializeMap for Serializer<'a> {
impl ser::SerializeMap for Serializer<'_> {
type Ok = ();
type Error = Error;

Expand Down Expand Up @@ -389,7 +389,7 @@ impl<'a> ser::SerializeMap for Serializer<'a> {
/// Serialize structs, recursively handling any inner compound structures by using the key name as
/// the new prefix. (No need to use the struct's name; we're not at the root level, so it was
/// already pointed to by some name.)
impl<'a> ser::SerializeStruct for Serializer<'a> {
impl ser::SerializeStruct for Serializer<'_> {
type Ok = ();
type Error = Error;

Expand Down Expand Up @@ -447,7 +447,7 @@ impl<'a> FlatSerializer<'a> {
}
}

impl<'a> ser::SerializeSeq for FlatSerializer<'a> {
impl ser::SerializeSeq for FlatSerializer<'_> {
type Ok = ();
type Error = Error;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ impl Migration for ReplaceStringMigration {
// String is the only type we use today, and handling multiple value types is more complicated than
// we need at the moment. Allowing &[serde_json::Value] seems nice, but it would allow arbitrary
// data transformations that the API model would then fail to load.

pub struct ListReplacement {
pub setting: &'static str,
pub old_vals: &'static [&'static str],
Expand Down Expand Up @@ -1373,7 +1372,6 @@ mod test_remove_metadata {
// String is the only type we use today, and handling multiple value types is more complicated than
// we need at the moment. Allowing &[serde_json::Value] seems nice, but it would allow arbitrary
// data transformations that the API model would then fail to load.

pub struct MetadataListReplacement {
pub setting: &'static str,
pub metadata: &'static str,
Expand Down
2 changes: 0 additions & 2 deletions sources/api/schnauzer/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,6 @@ pub fn toml_encode(

/// kube_reserve_memory and kube_reserve_cpu are taken from EKS' calculations.
/// /~https://github.com/awslabs/amazon-eks-ami/blob/db28da15d2b696bc08ac3aacc9675694f4a69933/files/bootstrap.sh
/// Calculates the amount of memory to reserve for kubeReserved in mebibytes.
/// Formula: memory_to_reserve = max_num_pods * 11 + 255 is taken from
/// /~https://github.com/awslabs/amazon-eks-ami/pull/419#issuecomment-609985305
Expand Down Expand Up @@ -1438,7 +1437,6 @@ pub fn etc_hosts_entries(
/// The first argument for the helper is the default value; the second argument is the key to
/// negate. Both values must be booleans, otherwise the helper will return an error. The default
/// value will be returned as it is if the provided key is missing.
pub fn negate_or_else(
helper: &Helper<'_, '_>,
_: &Handlebars,
Expand Down

0 comments on commit da22032

Please sign in to comment.