Skip to content

Commit

Permalink
chore: cargo clippy --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Oct 25, 2023
1 parent ddddae5 commit 5237930
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion abci/tests/common/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,6 @@ impl Drop for TenderdashDocker {
pub fn setup_td_logs_panic(td_docker: &Arc<TenderdashDocker>) {
let weak_ref = Arc::downgrade(td_docker);
std::panic::set_hook(Box::new(move |_| {
weak_ref.upgrade().map(|td| td.print_logs());
if let Some(td) = weak_ref.upgrade() { td.print_logs() }
}));
}
3 changes: 1 addition & 2 deletions abci/tests/kvstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ mod common;

use std::{
collections::{BTreeMap, BTreeSet},
mem,
ops::Deref,
sync::{RwLock, RwLockWriteGuard},
};
Expand Down Expand Up @@ -95,7 +94,7 @@ impl KVStore {
}

pub(crate) fn commit(&mut self) {
let pending_operations = mem::replace(&mut self.pending_operations, BTreeSet::new());
let pending_operations = std::mem::take(&mut self.pending_operations);
pending_operations
.into_iter()
.for_each(|op| op.apply(&mut self.persisted_state));
Expand Down
6 changes: 3 additions & 3 deletions abci/tests/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use tenderdash_abci::proto;
fn test_ipv4_server() {
// we assume the host uses default Docker network configuration, with the host
// using 172.17.0.1
let bind_address = format!("tcp://172.17.0.1:1234");
let bind_address = "tcp://172.17.0.1:1234".to_string();

tcp_server_test("v4", bind_address.as_str());
}
Expand All @@ -27,7 +27,7 @@ fn test_ipv4_server() {
fn test_ipv6_server() {
// we assume the host uses default Docker network configuration, with the host
// using 172.17.0.1. This is IPv6 notation of the IPv4 address.
let bind_address = format!("tcp://[::ffff:ac11:1]:5678");
let bind_address = "tcp://[::ffff:ac11:1]:5678".to_string();

tcp_server_test("v6", bind_address.as_str());
}
Expand All @@ -50,7 +50,7 @@ fn tcp_server_test(test_name: &str, bind_address: &str) {

let app = TestDispatcher {};

let server = ServerBuilder::new(app, &bind_address)
let server = ServerBuilder::new(app, bind_address)
.build()
.expect("server failed");
let socket_uri = bind_address.to_string();
Expand Down
2 changes: 1 addition & 1 deletion proto-compiler/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub fn abci_version<T: AsRef<Path>>(dir: T) -> String {
let contents = read_to_string(&file_path).expect("cannot read version/version.go");
use regex::Regex;

let re = Regex::new(r##"(?m)^\s+ABCISemVer\s*=\s*"([^"]+)"\s+*$"##).unwrap();
let re = Regex::new(r#"(?m)^\s+ABCISemVer\s*=\s*"([^"]+)"\s+*$"#).unwrap();
let captures = re
.captures(&contents)
.expect("cannot find ABCISemVer in version/version.go");
Expand Down

0 comments on commit 5237930

Please sign in to comment.