Clippy fixes

Clippy just broke under our feets by enabling more checks and making CI
fail...
This commit is contained in:
Antoine Poinsot 2022-11-05 11:51:45 +01:00
parent 76bd319d88
commit 3b2c9109dd
No known key found for this signature in database
GPG Key ID: E13FC145CD3F4304
4 changed files with 7 additions and 7 deletions

View File

@ -20,7 +20,7 @@ use serde::{Deserialize, Serialize};
#[derive(Debug)]
pub enum DescCreationError {
InsaneTimelock(u32),
InvalidKey(descriptor::DescriptorPublicKey),
InvalidKey(Box<descriptor::DescriptorPublicKey>),
Miniscript(miniscript::Error),
IncompatibleDesc,
DerivedKeyParsing,
@ -233,7 +233,7 @@ impl str::FromStr for MultipathDescriptor {
}
});
if let Some(key) = invalid_key {
return Err(DescCreationError::InvalidKey(key));
return Err(DescCreationError::InvalidKey(key.into()));
}
// Semantic of the Miniscript must be either the owner now, or the heir after
@ -334,7 +334,7 @@ impl MultipathDescriptor {
.iter()
.find(|k| !is_valid_desc_key(k))
{
return Err(DescCreationError::InvalidKey((**key).clone()));
return Err(DescCreationError::InvalidKey((**key).clone().into()));
}
let owner_pk = Miniscript::from_ast(Terminal::Check(sync::Arc::from(

View File

@ -52,7 +52,7 @@ fn update_spend(control: &DaemonControl, params: Params) -> Result<serde_json::V
.get(0, "psbt")
.ok_or_else(|| Error::invalid_params("Missing 'psbt' parameter."))?
.as_str()
.and_then(|s| base64::decode(&s).ok())
.and_then(|s| base64::decode(s).ok())
.and_then(|bytes| consensus::deserialize(&bytes).ok())
.ok_or_else(|| Error::invalid_params("Invalid 'psbt' parameter."))?;
control.update_spend(psbt)?;

View File

@ -249,7 +249,7 @@ mod tests {
}
fn write_messages(socket_path: &path::Path, messages: &[&[u8]]) {
let mut client = net::UnixStream::connect(&socket_path).unwrap();
let mut client = net::UnixStream::connect(socket_path).unwrap();
for mess in messages {
client.write_all(mess).unwrap();
// Simulate throttling, this mimics real conditions and actually triggered a crash.

View File

@ -583,10 +583,10 @@ mod tests {
]
.iter()
.collect();
fs::write(&cookie, &[0; 32]).unwrap(); // Will overwrite should it exist already
fs::write(&cookie, [0; 32]).unwrap(); // Will overwrite should it exist already
let addr: net::SocketAddr =
net::SocketAddrV4::new(net::Ipv4Addr::new(127, 0, 0, 1), 0).into();
let server = net::TcpListener::bind(&addr).unwrap();
let server = net::TcpListener::bind(addr).unwrap();
let addr = server.local_addr().unwrap();
let bitcoin_config = BitcoinConfig {
network,