From: Elias Rohrer Date: Thu, 6 Jun 2024 11:06:59 +0000 (+0200) Subject: `rustfmt`: `fuzz/src/chanmon_deser.rs` X-Git-Tag: v0.0.124-beta~91^2~14 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=39cc28bfaa26a4fe4694cc92dba4f537a96739e7;p=rust-lightning `rustfmt`: `fuzz/src/chanmon_deser.rs` --- diff --git a/fuzz/src/chanmon_deser.rs b/fuzz/src/chanmon_deser.rs index 8d425357c..b9c012137 100644 --- a/fuzz/src/chanmon_deser.rs +++ b/fuzz/src/chanmon_deser.rs @@ -4,8 +4,8 @@ use bitcoin::hash_types::BlockHash; use lightning::chain::channelmonitor; +use lightning::util::ser::{ReadableArgs, Writeable, Writer}; use lightning::util::test_channel_signer::TestChannelSigner; -use lightning::util::ser::{ReadableArgs, Writer, Writeable}; use lightning::util::test_utils::OnlyReadsKeysInterface; use crate::utils::test_logger; @@ -22,10 +22,19 @@ impl Writer for VecWriter { #[inline] pub fn do_test(data: &[u8], _out: Out) { - if let Ok((latest_block_hash, monitor)) = <(BlockHash, channelmonitor::ChannelMonitor)>::read(&mut Cursor::new(data), (&OnlyReadsKeysInterface {}, &OnlyReadsKeysInterface {})) { + if let Ok((latest_block_hash, monitor)) = + <(BlockHash, channelmonitor::ChannelMonitor)>::read( + &mut Cursor::new(data), + (&OnlyReadsKeysInterface {}, &OnlyReadsKeysInterface {}), + ) { let mut w = VecWriter(Vec::new()); monitor.write(&mut w).unwrap(); - let deserialized_copy = <(BlockHash, channelmonitor::ChannelMonitor)>::read(&mut Cursor::new(&w.0), (&OnlyReadsKeysInterface {}, &OnlyReadsKeysInterface {})).unwrap(); + let deserialized_copy = + <(BlockHash, channelmonitor::ChannelMonitor)>::read( + &mut Cursor::new(&w.0), + (&OnlyReadsKeysInterface {}, &OnlyReadsKeysInterface {}), + ) + .unwrap(); assert!(latest_block_hash == deserialized_copy.0); assert!(monitor == deserialized_copy.1); } @@ -37,5 +46,5 @@ pub fn chanmon_deser_test(data: &[u8], out: Out) { #[no_mangle] pub extern "C" fn chanmon_deser_run(data: *const u8, datalen: usize) { - do_test(unsafe { std::slice::from_raw_parts(data, datalen) }, test_logger::DevNull{}); + do_test(unsafe { std::slice::from_raw_parts(data, datalen) }, test_logger::DevNull {}); } diff --git a/rustfmt_excluded_files b/rustfmt_excluded_files index 177a22b77..89dd4ab41 100644 --- a/rustfmt_excluded_files +++ b/rustfmt_excluded_files @@ -1,6 +1,5 @@ ./bench/benches/bench.rs ./fuzz/src/chanmon_consistency.rs -./fuzz/src/chanmon_deser.rs ./fuzz/src/fromstr_to_netaddress.rs ./fuzz/src/full_stack.rs ./fuzz/src/indexedmap.rs