diff --git a/build-helper.rs b/build-helper.rs index 617e3ea..9dffaf8 100644 --- a/build-helper.rs +++ b/build-helper.rs @@ -86,7 +86,7 @@ impl Default for LoreVergen { warning = revision_info.warning; } - LoreVergen { + Self { lore_library_version_name: format!("{package_version}+{lib_version}"), warning, } diff --git a/lore-aws/src/clients.rs b/lore-aws/src/clients.rs index 3f1bdc9..ea5405d 100644 --- a/lore-aws/src/clients.rs +++ b/lore-aws/src/clients.rs @@ -73,7 +73,7 @@ pub struct TaskQueueSettings { impl Default for TaskQueueSettings { fn default() -> Self { - TaskQueueSettings { + Self { quota_per_second: default_quota_per_second(), concurrency_limit: default_concurrency_limit(), submission_limit: default_submission_limit(), @@ -251,7 +251,7 @@ pub struct WantsTables { } impl AwsClientBuilder { - pub fn ensure_table(mut self, table_name: impl Into) -> AwsClientBuilder { + pub fn ensure_table(mut self, table_name: impl Into) -> Self { self.0.tables.push(table_name.into()); self @@ -294,7 +294,7 @@ pub struct WantsBuckets { } impl AwsClientBuilder { - pub fn ensure_bucket(mut self, bucket: impl Into) -> AwsClientBuilder { + pub fn ensure_bucket(mut self, bucket: impl Into) -> Self { self.0.buckets.push(bucket.into()); self diff --git a/lore-aws/src/store/immutable_store.rs b/lore-aws/src/store/immutable_store.rs index 9fcd6ff..0971d44 100644 --- a/lore-aws/src/store/immutable_store.rs +++ b/lore-aws/src/store/immutable_store.rs @@ -75,7 +75,7 @@ struct FragmentsEntry { impl From<&FragmentsEntry> for Address { fn from(value: &FragmentsEntry) -> Self { - Address { + Self { hash: value.hash, context: Context::from(&value.repository_context[size_of::()..]), } @@ -233,14 +233,14 @@ enum FragmentsQuery { impl DynamoDbQuery for FragmentsQuery { fn key_condition_expression(&self) -> &str { match self { - FragmentsQuery::Repository(_, _) => "#pk = :hash and begins_with(#sk, :repository)", - FragmentsQuery::Hash(_) | FragmentsQuery::HashCount(_) => "#pk = :hash", + Self::Repository(_, _) => "#pk = :hash and begins_with(#sk, :repository)", + Self::Hash(_) | Self::HashCount(_) => "#pk = :hash", } } fn expression_attribute_names(&self) -> HashMap { match self { - FragmentsQuery::Repository(_, _) => HashMap::from([ + Self::Repository(_, _) => HashMap::from([ ( "#pk".to_string(), FRAGMENTS_DYNAMO_PARTITION_KEY_ATTRIBUTE.to_string(), @@ -250,7 +250,7 @@ impl DynamoDbQuery for FragmentsQuery { FRAGMENTS_DYNAMO_SORT_KEY_ATTRIBUTE.to_string(), ), ]), - FragmentsQuery::Hash(_) | FragmentsQuery::HashCount(_) => HashMap::from([( + Self::Hash(_) | Self::HashCount(_) => HashMap::from([( "#pk".to_string(), FRAGMENTS_DYNAMO_PARTITION_KEY_ATTRIBUTE.to_string(), )]), @@ -259,7 +259,7 @@ impl DynamoDbQuery for FragmentsQuery { fn expression_attribute_values(&self) -> HashMap { match self { - FragmentsQuery::Repository(hash, repository) => HashMap::from([ + Self::Repository(hash, repository) => HashMap::from([ ( ":hash".to_string(), AttributeValue::B(Blob::new(hash.data())), @@ -269,7 +269,7 @@ impl DynamoDbQuery for FragmentsQuery { AttributeValue::B(Blob::new(repository.data())), ), ]), - FragmentsQuery::Hash(hash) | FragmentsQuery::HashCount(hash) => HashMap::from([( + Self::Hash(hash) | Self::HashCount(hash) => HashMap::from([( ":hash".to_string(), AttributeValue::B(Blob::new(hash.data())), )]), @@ -278,20 +278,20 @@ impl DynamoDbQuery for FragmentsQuery { fn limit(&self) -> Option { match self { - FragmentsQuery::Repository(_, _) | FragmentsQuery::Hash(_) => Some(1), - FragmentsQuery::HashCount(_) => None, + Self::Repository(_, _) | Self::Hash(_) => Some(1), + Self::HashCount(_) => None, } } fn select(&self) -> Option