Skip to content

Commit feedd3a

Browse files
committed
fmt
1 parent 0ca79d0 commit feedd3a

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

src/io/vss_store.rs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ impl VssStore {
2828
Self { client, store_id, runtime }
2929
}
3030

31-
fn build_key(&self, primary_namespace: &str, secondary_namespace: &str, key: &str) -> io::Result<String> {
31+
fn build_key(
32+
&self, primary_namespace: &str, secondary_namespace: &str, key: &str,
33+
) -> io::Result<String> {
3234
if primary_namespace.is_empty() {
3335
Ok(key.to_string())
3436
} else {
@@ -45,7 +47,9 @@ impl VssStore {
4547
}
4648
}
4749

48-
async fn list_all_keys(&self, primary_namespace: &str, secondary_namespace: &str) -> io::Result<Vec<String>> {
50+
async fn list_all_keys(
51+
&self, primary_namespace: &str, secondary_namespace: &str,
52+
) -> io::Result<Vec<String>> {
4953
let mut page_token = None;
5054
let mut keys = vec![];
5155
let key_prefix = format!("{}#{}", primary_namespace, secondary_namespace);
@@ -58,7 +62,10 @@ impl VssStore {
5862
};
5963

6064
let response = self.client.list_key_versions(&request).await.map_err(|e| {
61-
let msg = format!("Failed to list keys in {}/{}: {}", primary_namespace, secondary_namespace, e);
65+
let msg = format!(
66+
"Failed to list keys in {}/{}: {}",
67+
primary_namespace, secondary_namespace, e
68+
);
6269
Error::new(ErrorKind::Other, msg)
6370
})?;
6471

@@ -72,7 +79,9 @@ impl VssStore {
7279
}
7380

7481
impl KVStore for VssStore {
75-
fn read(&self, primary_namespace: &str, secondary_namespace: &str, key: &str) -> io::Result<Vec<u8>> {
82+
fn read(
83+
&self, primary_namespace: &str, secondary_namespace: &str, key: &str,
84+
) -> io::Result<Vec<u8>> {
7685
check_namespace_key_validity(primary_namespace, secondary_namespace, Some(key), "read")?;
7786
let request = GetObjectRequest {
7887
store_id: self.store_id.to_string(),
@@ -100,7 +109,9 @@ impl KVStore for VssStore {
100109
Ok(resp.value.unwrap().value)
101110
}
102111

103-
fn write(&self, primary_namespace: &str, secondary_namespace: &str, key: &str, buf: &[u8]) -> io::Result<()> {
112+
fn write(
113+
&self, primary_namespace: &str, secondary_namespace: &str, key: &str, buf: &[u8],
114+
) -> io::Result<()> {
104115
check_namespace_key_validity(primary_namespace, secondary_namespace, Some(key), "write")?;
105116
let request = PutObjectRequest {
106117
store_id: self.store_id.to_string(),
@@ -140,8 +151,10 @@ impl KVStore for VssStore {
140151

141152
tokio::task::block_in_place(|| self.runtime.block_on(self.client.delete_object(&request)))
142153
.map_err(|e| {
143-
let msg =
144-
format!("Failed to delete key {}/{}/{}: {}", primary_namespace, secondary_namespace, key, e);
154+
let msg = format!(
155+
"Failed to delete key {}/{}/{}: {}",
156+
primary_namespace, secondary_namespace, key, e
157+
);
145158
Error::new(ErrorKind::Other, msg)
146159
})?;
147160
Ok(())

0 commit comments

Comments
 (0)