Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Whitehead <[email protected]>
  • Loading branch information
andrewwhitehead committed Sep 20, 2023
1 parent 8135940 commit e80ce7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions indy-credx/src/services/tails.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion indy-credx/src/services/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
Expand Down

0 comments on commit e80ce7c

Please sign in to comment.