Fix two new compiler warnings in fuzz 2021-03-fix-warns
authorMatt Corallo <git@bluematt.me>
Wed, 31 Mar 2021 03:21:00 +0000 (23:21 -0400)
committerMatt Corallo <git@bluematt.me>
Wed, 31 Mar 2021 03:21:54 +0000 (23:21 -0400)
This fixes two trivial compiler warnings in fuzz that point to
broken usage of explicit `panic!()`s.

fuzz/src/chanmon_consistency.rs
fuzz/src/router.rs

index 7c5875ac1ef62d31590241228027fd75b954aba2..e7cd990086163910ebd061f798325ac301ee9950 100644 (file)
@@ -234,7 +234,7 @@ fn check_api_err(api_err: APIError) {
                                _ if err.starts_with("Cannot send value that would put our balance under counterparty-announced channel reserve value") => {},
                                _ if err.starts_with("Cannot send value that would overdraw remaining funds.") => {},
                                _ if err.starts_with("Cannot send value that would not leave enough to pay for fees.") => {},
-                               _ => panic!(err),
+                               _ => panic!("{}", err),
                        }
                },
                APIError::MonitorUpdateFailed => {
index e93618ca7137905ab7677a775e3697e390b6cd02..fb720c9916c2d7b38ee653df9fea675f3f8ea23f 100644 (file)
@@ -130,7 +130,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
                                        msgs::DecodeError::InvalidValue => return,
                                        msgs::DecodeError::BadLengthDescriptor => return,
                                        msgs::DecodeError::ShortRead => panic!("We picked the length..."),
-                                       msgs::DecodeError::Io(e) => panic!(format!("{:?}", e)),
+                                       msgs::DecodeError::Io(e) => panic!("{:?}", e),
                                }
                        }
                }}