refactor to pass slices around and not &Vec<> (#498)

cleaned up a couple of unwrap() calls
This commit is contained in:
Antioch Peverell
2020-08-03 10:29:54 +01:00
committed by GitHub
parent 7a003374ac
commit e00c61fd05
9 changed files with 50 additions and 57 deletions
+2 -2
View File
@@ -47,7 +47,7 @@ impl<'a> PathToSlatepack<'a> {
pub fn get_slatepack(&self, decrypt: bool) -> Result<Slatepack, Error> {
let data = self.get_slatepack_file_contents()?;
self.packer.deser_slatepack(data, decrypt)
self.packer.deser_slatepack(&data, decrypt)
}
}
@@ -80,7 +80,7 @@ impl<'a> SlatePutter for PathToSlatepack<'a> {
impl<'a> SlateGetter for PathToSlatepack<'a> {
fn get_tx(&self) -> Result<(Slate, bool), Error> {
let data = self.get_slatepack_file_contents()?;
let slatepack = self.packer.deser_slatepack(data, true)?;
let slatepack = self.packer.deser_slatepack(&data, true)?;
Ok((self.packer.get_slate(&slatepack)?, true))
}
}