From 7871b9e74a7bf9fa0c89b137d9b9f21e587f900b Mon Sep 17 00:00:00 2001 From: adamnemecek Date: Wed, 17 Jun 2026 09:06:16 -0700 Subject: [PATCH 1/2] ran `cargo clippy --allow-dirty --fix -- -Wclippy::use_self` --- build-helper.rs | 2 +- lore-aws/src/clients.rs | 6 +- lore-aws/src/store/immutable_store.rs | 24 +++--- lore-aws/src/store/lock_store.rs | 60 +++++++------- lore-base/src/fs/lock.rs | 6 +- lore-base/src/runtime.rs | 2 +- lore-base/src/types/fragment_flags.rs | 6 +- lore-base/src/types/mod.rs | 82 +++++++++---------- lore-base/src/types/store_types.rs | 16 ++-- lore-base/src/types/typed_bytes.rs | 6 +- lore-base/src/types/verify_types.rs | 8 +- lore-chaos-client/src/chaos/runner.rs | 2 +- lore-chaos-client/src/lore/interface.rs | 2 +- lore-chaos-client/src/lore/state.rs | 2 +- lore-chaos-client/src/operations.rs | 32 ++++---- lore-chaos-client/src/probability.rs | 2 +- .../src/probability/weighting.rs | 10 +-- lore-client/src/cli/config.rs | 4 +- lore-client/src/cli/pager.rs | 4 +- lore-client/src/cli/progress_bar.rs | 12 +-- lore-error-set/src/internal.rs | 2 +- lore-hashicorp/src/consul/client.rs | 2 +- lore-macro/src/lore_instrument.rs | 4 +- lore-proto/src/convert.rs | 60 +++++++------- lore-revision/src/anchor.rs | 4 +- lore-revision/src/auth/login.rs | 16 ++-- lore-revision/src/branch.rs | 34 ++++---- lore-revision/src/branch/create.rs | 24 +++--- lore-revision/src/branch/info.rs | 2 +- lore-revision/src/branch/merge.rs | 22 ++--- lore-revision/src/branch/push.rs | 20 ++--- lore-revision/src/branch/reset.rs | 20 ++--- lore-revision/src/change.rs | 42 +++++----- lore-revision/src/cluster/peer.rs | 4 +- lore-revision/src/commit.rs | 2 +- lore-revision/src/dependency/mod.rs | 6 +- lore-revision/src/errors/mod.rs | 4 +- lore-revision/src/event.rs | 2 +- lore-revision/src/file/diff.rs | 14 ++-- lore-revision/src/file/history.rs | 12 +-- lore-revision/src/file/info.rs | 6 +- lore-revision/src/file/obliterate.rs | 8 +- lore-revision/src/file/reset.rs | 8 +- lore-revision/src/file/unstage.rs | 2 +- lore-revision/src/file/write.rs | 10 +-- lore-revision/src/fs/filesystem_provider.rs | 34 ++++---- lore-revision/src/instance.rs | 2 +- lore-revision/src/interface.rs | 68 +++++++-------- lore-revision/src/link.rs | 26 +++--- lore-revision/src/metadata.rs | 24 +++--- lore-revision/src/metadata/branch.rs | 2 +- lore-revision/src/metadata/repository.rs | 2 +- lore-revision/src/metadata/set.rs | 4 +- lore-revision/src/nametable.rs | 10 +-- lore-revision/src/node.rs | 28 +++---- lore-revision/src/notification.rs | 2 +- lore-revision/src/repository.rs | 70 ++++++++-------- lore-revision/src/repository/clone.rs | 28 +++---- lore-revision/src/repository/create.rs | 12 +-- lore-revision/src/repository/status.rs | 24 +++--- lore-revision/src/revision.rs | 2 +- lore-revision/src/revision/bisect.rs | 10 +-- lore-revision/src/revision/diff.rs | 2 +- lore-revision/src/revision/history.rs | 4 +- lore-revision/src/revision/info.rs | 4 +- lore-revision/src/revision/restore.rs | 20 ++--- lore-revision/src/revision/sync.rs | 2 +- lore-revision/src/shared_store.rs | 2 +- lore-revision/src/state.rs | 24 +++--- lore-revision/src/state/sink.rs | 8 +- lore-revision/src/store/composite.rs | 30 +++---- lore-revision/src/store/remote.rs | 4 +- lore-revision/src/util/fs.rs | 6 +- lore-revision/src/util/inflight.rs | 2 +- lore-revision/src/util/path.rs | 34 ++++---- lore-revision/src/util/task_queue.rs | 4 +- lore-server/src/auth/jwk.rs | 2 +- lore-server/src/authnz/auth.rs | 4 +- lore-server/src/authnz/rebac.rs | 4 +- lore-server/src/correlation/mod.rs | 2 +- lore-server/src/grpc/mod.rs | 4 +- lore-server/src/hooks/registry.rs | 2 +- lore-server/src/hooks/traits.rs | 34 ++++---- .../src/http/presigned/repository/redeem.rs | 10 +-- .../content/get_repository_content.rs | 6 +- .../content/presign_repository_content.rs | 8 +- lore-server/src/http/server.rs | 2 +- .../replication_store/exists_batch.rs | 6 +- .../src/protocol/replication_store/get.rs | 6 +- .../src/protocol/replication_store/header.rs | 2 +- .../protocol/replication_store/obliterate.rs | 2 +- .../src/protocol/replication_store/put.rs | 2 +- .../src/protocol/replication_store/query.rs | 6 +- lore-server/src/protocol/storage/messages.rs | 6 +- lore-server/src/protocol/storage/verify.rs | 2 +- lore-server/src/quic/quinn/metrics.rs | 4 +- .../src/quic/replication_store_service.rs | 32 ++++---- .../quic/replication_store_service/client.rs | 8 +- .../client_container.rs | 2 +- lore-server/src/server.rs | 2 +- lore-server/src/settings.rs | 2 +- lore-server/src/store/grpc_replica.rs | 8 +- lore-server/src/store/replicated_store.rs | 6 +- lore-server/src/topology/composite.rs | 2 +- lore-server/src/topology/fixed.rs | 2 +- lore-server/src/topology/mod.rs | 10 +-- lore-server/src/topology/rotating_id_fixed.rs | 2 +- lore-server/src/util/cert_metrics.rs | 4 +- lore-storage/src/compress.rs | 10 +-- lore-storage/src/compress/pool.rs | 4 +- lore-storage/src/local/immutable_store.rs | 14 ++-- lore-storage/src/local/mutable_store.rs | 14 ++-- lore-storage/src/options.rs | 2 +- lore-storage/src/packstore.rs | 2 +- lore-storage/src/store_types.rs | 26 +++--- lore-telemetry/src/config.rs | 2 +- lore-transport/src/error.rs | 30 +++---- lore-transport/src/grpc/environment_client.rs | 2 +- lore-transport/src/grpc/mod.rs | 6 +- lore-transport/src/quic/client.rs | 2 +- lore-transport/src/quic/command_header.rs | 2 +- lore-transport/src/quic/response_reader.rs | 2 +- .../src/quic/storage_service/client.rs | 4 +- .../src/quic/storage_service/mod.rs | 28 +++---- lore-transport/src/session.rs | 2 +- lore-transport/src/types.rs | 6 +- lore/src/remote/message.rs | 8 +- lore/src/remote/network/stub.rs | 4 +- lore/src/revision_tree/call.rs | 4 +- lore/src/storage/call.rs | 4 +- lore/src/storage/close.rs | 4 +- lore/src/storage/copy.rs | 4 +- lore/src/storage/flush.rs | 2 +- lore/src/storage/get.rs | 4 +- lore/src/storage/get_file.rs | 4 +- lore/src/storage/get_metadata.rs | 4 +- lore/src/storage/obliterate.rs | 4 +- lore/src/storage/open.rs | 4 +- lore/src/storage/put.rs | 4 +- lore/src/storage/put_file.rs | 4 +- lore/src/storage/upload.rs | 4 +- 141 files changed, 763 insertions(+), 763 deletions(-) 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