refactor(core): remove VersionBytes::into_inner use Into<Vec<u8>> instead

use `Into<Vec<u8>>` to match the `AsRef<[u8]>` api
This commit is contained in:
2021-05-13 16:17:51 +02:00
parent 651b99e973
commit cef608bdd2
3 changed files with 4 additions and 8 deletions

View File

@@ -436,7 +436,7 @@ where
let clear_text = self
.cryptor
.decrypt(key.key(), state.into_inner())
.decrypt(key.key(), state.into())
.await
.with_context(|| format!("failed decrypting remote state {}", name))?;
@@ -500,7 +500,7 @@ where
data.ensure_versions_phf(&SUPPORTED_VERSIONS)?;
let clear_text = self
.cryptor
.decrypt(key.key(), data.into_inner())
.decrypt(key.key(), data.into())
.await
.unwrap();

View File

@@ -70,7 +70,7 @@ where
let val = stream::iter(vals)
.map(|vb| {
vb.ensure_versions(supported_versions)?;
Ok(vb.into_inner())
Ok(vb.into())
})
.map_ok(|buf| {
buf_decode(buf).map(|res| res.context("Custom buffer decode function failed"))
@@ -104,7 +104,7 @@ where
let val = stream::iter(vals)
.map(|vb| {
vb.ensure_versions_phf(supported_versions)?;
Ok(vb.into_inner())
Ok(vb.into())
})
.map_ok(|buf| {
buf_decode(buf).map(|res| res.context("Custom buffer decode function failed"))

View File

@@ -73,10 +73,6 @@ impl VersionBytes {
self.as_version_bytes_ref().ensure_versions_phf(versions)
}
pub fn into_inner(self) -> Vec<u8> {
self.1
}
pub fn as_version_bytes_ref(&self) -> VersionBytesRef<'_> {
VersionBytesRef::new(self.version(), self.as_ref())
}