Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
Clear clippy warnings
Browse files Browse the repository at this point in the history
Clear all the clippy warnings introduce by a recent clippy update.
  • Loading branch information
tcharding committed Nov 16, 2022
1 parent 7c94adf commit acca8ba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl Client {
let id = request.id.clone();

let response = self.send_request(request)?;
if response.jsonrpc != None && response.jsonrpc != Some(From::from("2.0")) {
if response.jsonrpc.is_some() && response.jsonrpc != Some(From::from("2.0")) {
return Err(Error::VersionMismatch);
}
if response.id != id {
Expand Down
6 changes: 3 additions & 3 deletions src/simple_http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ mod tests {
"http://me:weak@localhost:22/wallet",
];
for u in &urls {
let tp = Builder::new().url(*u).unwrap().build();
let tp = Builder::new().url(u).unwrap().build();
assert_eq!(tp.addr, addr);
}

Expand All @@ -506,7 +506,7 @@ mod tests {
];
for u in &valid_urls {
let (addr, path) = check_url(u).unwrap();
let builder = Builder::new().url(*u).unwrap_or_else(|_| panic!("error for: {}", u));
let builder = Builder::new().url(u).unwrap_or_else(|_| panic!("error for: {}", u));
assert_eq!(builder.tp.addr, addr);
assert_eq!(builder.tp.path, path);
assert_eq!(builder.tp.timeout, Duration::from_secs(15));
Expand All @@ -523,7 +523,7 @@ mod tests {
// NB somehow, Rust's IpAddr accepts "127.0.0" and adds the extra 0..
];
for u in &invalid_urls {
if let Ok(b) = Builder::new().url(*u) {
if let Ok(b) = Builder::new().url(u) {
let tp = b.build();
panic!("expected error for url {}, got {:?}", u, tp);
}
Expand Down
4 changes: 2 additions & 2 deletions src/simple_tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl TcpTransport {
where
R: for<'a> serde::de::Deserialize<'a>,
{
let mut sock = net::TcpStream::connect(&self.addr)?;
let mut sock = net::TcpStream::connect(self.addr)?;
sock.set_read_timeout(self.timeout)?;
sock.set_write_timeout(self.timeout)?;

Expand Down Expand Up @@ -129,7 +129,7 @@ mod tests {
fn sanity_check_tcp_transport() {
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 dummy_req = Request {
method: "arandommethod",
Expand Down

0 comments on commit acca8ba

Please sign in to comment.