diff --git a/gossip/src/contact_info.rs b/gossip/src/contact_info.rs index def95ed391a53c..e3e51f59f5136c 100644 --- a/gossip/src/contact_info.rs +++ b/gossip/src/contact_info.rs @@ -527,9 +527,7 @@ fn sanitize_entries(addrs: &[IpAddr], sockets: &[SocketEntry]) -> Result<(), Err // Verify that port offsets don't overflow. if sockets .iter() - .fold(Some(0u16), |offset, entry| { - offset?.checked_add(entry.offset) - }) + .try_fold(0u16, |offset, entry| offset.checked_add(entry.offset)) .is_none() { return Err(Error::PortOffsetsOverflow); diff --git a/ledger-tool/src/program.rs b/ledger-tool/src/program.rs index 57f977b5fa7f48..95b5792d356bf0 100644 --- a/ledger-tool/src/program.rs +++ b/ledger-tool/src/program.rs @@ -177,7 +177,7 @@ impl ProgramSubCommand for App<'_, '_> { .arg( Arg::with_name("input") .help( - r##"Input for the program to run on, where FILE is a name of a JSON file + r#"Input for the program to run on, where FILE is a name of a JSON file with input data, or BYTES is the number of 0-valued bytes to allocate for program parameters" The input data for a program execution have to be in JSON format @@ -196,7 +196,7 @@ and the following fields are required ], "instruction_data": [31, 32, 23, 24] } -"##, +"#, ) .short("i") .long("input") diff --git a/merkle-tree/src/merkle_tree.rs b/merkle-tree/src/merkle_tree.rs index d08e111d4ef93e..09285a41e7af1f 100644 --- a/merkle-tree/src/merkle_tree.rs +++ b/merkle-tree/src/merkle_tree.rs @@ -58,7 +58,7 @@ impl<'a> Proof<'a> { None } }); - matches!(result, Some(_)) + result.is_some() } }