Skip to content

Commit

Permalink
fix: remove &Vec<u8> (MrCroxx#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
zackertypical committed Apr 10, 2022
1 parent 80bb848 commit 212f2a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rudder/src/meta/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@ impl ObjectMetaStore {
Self { object_store, path }
}

async fn put(&self, key: &Vec<u8>, value: Vec<u8>) -> Result<()> {
async fn put(&self, key: &[u8], value: Vec<u8>) -> Result<()> {
self.object_store
.put(&self.key(key), value)
.await
.map_err(Error::StorageError)
}

async fn get(&self, key: &Vec<u8>) -> Result<Option<Vec<u8>>> {
async fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
self.object_store
.get(&self.key(key))
.await
.map_err(Error::StorageError)
}

async fn remove(&self, key: &Vec<u8>) -> Result<()> {
async fn remove(&self, key: &[u8]) -> Result<()> {
self.object_store
.remove(&self.key(key))
.await
.map_err(Error::StorageError)
}

fn key(&self, key: &Vec<u8>) -> String {
fn key(&self, key: &[u8]) -> String {
format!("{}/{}", self.path, base64::encode(key))
}
}
Expand Down

0 comments on commit 212f2a3

Please sign in to comment.