Fix cheap clone Bytes and Overwatch crate name update

This commit is contained in:
Al Liu 2022-11-22 20:44:17 +08:00 committed by GitHub
parent 3a15a9b722
commit c127c1d18d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ edition = "2021"
[dependencies] [dependencies]
async-trait = "0.1" async-trait = "0.1"
bytes = "1.2" bytes = "1.2"
overwatch = { git = "https://github.com/logos-co/Overwatch", branch = "main" } overwatch-rs = { git = "https://github.com/logos-co/Overwatch", branch = "main" }
multiaddr = "0.15" multiaddr = "0.15"
serde = "1.0" serde = "1.0"
sled = { version = "0.34", optional = true } sled = { version = "0.34", optional = true }

View File

@ -46,7 +46,7 @@ impl<SerdeOp: StorageSerde + Send + Sync + 'static> StorageBackend for MockStora
} }
async fn load(&mut self, key: &[u8]) -> Result<Option<Bytes>, Self::Error> { async fn load(&mut self, key: &[u8]) -> Result<Option<Bytes>, Self::Error> {
Ok(self.inner.get(key).map(|b| Bytes::copy_from_slice(b))) Ok(self.inner.get(key).map(|b| b.clone()))
} }
async fn remove(&mut self, key: &[u8]) -> Result<Option<Bytes>, Self::Error> { async fn remove(&mut self, key: &[u8]) -> Result<Option<Bytes>, Self::Error> {