From 6d993028441880c965bf4f4baddb7342f45be805 Mon Sep 17 00:00:00 2001 From: igalshilman Date: Fri, 22 Nov 2024 18:04:44 +0100 Subject: [PATCH] Apply fmt --- .../metadata_store/providers/objstore/glue.rs | 7 +++---- .../providers/objstore/optimistic_store.rs | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/crates/core/src/metadata_store/providers/objstore/glue.rs b/crates/core/src/metadata_store/providers/objstore/glue.rs index 2bf9b221c..23515aa9e 100644 --- a/crates/core/src/metadata_store/providers/objstore/glue.rs +++ b/crates/core/src/metadata_store/providers/objstore/glue.rs @@ -157,11 +157,10 @@ impl MetadataStore for Client { precondition, tx, }) - .map_err(|_| WriteError::Internal("Object store fetch channel ".into()))?; + .map_err(|_| WriteError::Internal("Object store channel ".into()))?; - rx.await.map_err(|_| { - WriteError::Internal("Object store fetch channel disconnected".to_string()) - })? + rx.await + .map_err(|_| WriteError::Internal("Object store channel disconnected".to_string()))? } async fn delete(&self, key: ByteString, precondition: Precondition) -> Result<(), WriteError> { diff --git a/crates/core/src/metadata_store/providers/objstore/optimistic_store.rs b/crates/core/src/metadata_store/providers/objstore/optimistic_store.rs index c396def5c..42ed69b76 100644 --- a/crates/core/src/metadata_store/providers/objstore/optimistic_store.rs +++ b/crates/core/src/metadata_store/providers/objstore/optimistic_store.rs @@ -12,16 +12,16 @@ use rand::Rng; use std::sync::Arc; use std::time::Duration; -use anyhow::anyhow; -use bytestring::ByteString; -use tokio::time::Instant; -use restate_types::config::MetadataStoreClient; use crate::metadata_store::providers::objstore::immutable_store::ImmutableStore; use crate::metadata_store::providers::objstore::version_repository::{ VersionRepository, VersionRepositoryError, }; use crate::metadata_store::{Precondition, ReadError, VersionedValue, WriteError}; +use anyhow::anyhow; +use bytestring::ByteString; +use restate_types::config::MetadataStoreClient; use restate_types::Version; +use tokio::time::Instant; pub(crate) struct OptimisticLockingMetadataStoreBuilder { pub(crate) version_repository: Arc, @@ -158,7 +158,10 @@ impl OptimisticLockingMetadataStore { }; // make sure that the versions are incremental - assert_eq!(new_store.current_version(), current_store.store.current_version().next()); + assert_eq!( + new_store.current_version(), + current_store.store.current_version().next() + ); let new_store_bytes = new_store.serialize().map_err(WriteError::Store)?; @@ -195,7 +198,10 @@ impl OptimisticLockingMetadataStore { Err(WriteError::Internal("retry count exhausted".to_string())) } - pub(crate) async fn get(&mut self, key: ByteString) -> Result, ReadError> { + pub(crate) async fn get( + &mut self, + key: ByteString, + ) -> Result, ReadError> { let cached_store = self .get_or_update_store() .await