Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy committed Oct 12, 2021
1 parent e6f02d5 commit 3b648b6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
Expand Up @@ -35,26 +35,9 @@ impl PersistentLogViewer {
self.get_all().len()
}
}
pub fn write_into_persistent_log<P: AsRef<Path>>(
persistent_log: P,
entries: Vec<PersistentFragmentLog>,
) -> Result<(), Error> {
let mut output = BufWriter::with_capacity(128 * 1024, File::create(persistent_log.as_ref())?);

for entry in entries {
let codec = bincode::DefaultOptions::new().with_fixint_encoding();
let serialized = codec
.serialize(&entry)
.map_err(|_| Error::CannotSerializeEntry)?;
output.write_all(&serialized)?;
}
Ok(())
}

#[derive(custom_debug::Debug, thiserror::Error)]
pub enum Error {
#[error("cannot serialize entry of persistent log")]
CannotSerializeEntry,
#[error("cannot serialize entry of persistent log")]
Io(#[from] std::io::Error),
}
Expand Up @@ -20,12 +20,6 @@ use jormungandr_lib::interfaces::{
NodeSecret, NumberOfSlotsPerEpoch, Policy, SignedCertificate, SlotDuration, Tls, TrustedPeer,
Value,
};
use jormungandr_testing_utils::{
testing::{
Block0ConfigurationBuilder, JormungandrParams, NodeConfigBuilder, SecretModelFactory,
},
wallet::Wallet,
};
use std::path::PathBuf;
const DEFAULT_SLOT_DURATION: u8 = 2;

Expand Down

0 comments on commit 3b648b6

Please sign in to comment.