From e80ce7c5c2dffe5d3bddd8dd5799b79929833db8 Mon Sep 17 00:00:00 2001 From: Andrew Whitehead Date: Wed, 20 Sep 2023 12:28:41 -0700 Subject: [PATCH] fix warnings Signed-off-by: Andrew Whitehead --- indy-credx/src/services/tails.rs | 8 ++++---- indy-credx/src/services/verifier.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/indy-credx/src/services/tails.rs b/indy-credx/src/services/tails.rs index e2f83ad..4594efa 100644 --- a/indy-credx/src/services/tails.rs +++ b/indy-credx/src/services/tails.rs @@ -1,7 +1,7 @@ use std::cell::{RefCell, RefMut}; use std::fmt::Debug; use std::fs::File; -use std::io::{self, BufReader, BufWriter, Read, Seek, SeekFrom, Write}; +use std::io::{self, BufReader, BufWriter, Read, Seek, Write}; use std::path::{Path, PathBuf}; use indy_utils::base58; @@ -135,17 +135,17 @@ impl TailsWriter for TailsFileWriter { let mut buf = BufWriter::new(file); let mut hasher = Sha256::default(); let version = &[0u8, 2u8]; - buf.write(version)?; + buf.write_all(version)?; hasher.update(version); while let Some(tail) = generator.try_next()? { let tail_bytes = tail.to_bytes()?; - buf.write(&tail_bytes)?; + buf.write_all(&tail_bytes)?; hasher.update(&tail_bytes); } let mut file = buf .into_inner() .map_err(|e| err_msg!("Error flushing output file: {e}"))?; - let tails_size = file.seek(SeekFrom::Current(0))?; + let tails_size = file.stream_position()?; let hash = base58::encode(hasher.finalize()); let target_path = self.root_path.join(&hash); drop(file); diff --git a/indy-credx/src/services/verifier.rs b/indy-credx/src/services/verifier.rs index 36d311f..12b8526 100644 --- a/indy-credx/src/services/verifier.rs +++ b/indy-credx/src/services/verifier.rs @@ -678,7 +678,7 @@ fn verify_requested_restrictions( if pred_sub_proof_index == attr_sub_proof_index { for name in attr_info.values.keys() { let raw_val = attr_info.values.get(name).unwrap().raw.as_str(); - attr_value_map.insert(name.clone(), Some(raw_val.clone())); + attr_value_map.insert(name.clone(), Some(raw_val)); } } }