Skip to content

Commit

Permalink
Fix warnings in tests (#2846)
Browse files Browse the repository at this point in the history
  • Loading branch information
eupn authored and antiochp committed May 25, 2019
1 parent a2a350d commit f17dd5f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions api/tests/rest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use grin_util as util;
use crate::api::*;
use hyper::{Body, Request, StatusCode};
use std::net::SocketAddr;
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use std::{thread, time};

Expand All @@ -27,7 +27,7 @@ pub struct CounterMiddleware {
impl CounterMiddleware {
fn new() -> CounterMiddleware {
CounterMiddleware {
counter: ATOMIC_USIZE_INIT,
counter: AtomicUsize::new(0),
}
}

Expand Down
5 changes: 2 additions & 3 deletions chain/tests/mine_simple_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ use self::core::libtx::{self, build, reward};
use self::core::pow::Difficulty;
use self::core::{consensus, global, pow};
use self::keychain::{ExtKeychain, ExtKeychainPath, Keychain};
use self::util::{RwLock, StopState};
use self::util::RwLock;
use chrono::Duration;
use grin_chain as chain;
use grin_chain::{BlockStatus, ChainAdapter, Options};
use grin_core as core;
use grin_keychain as keychain;
use grin_util as util;
use std::cell::RefCell;
use std::fs;
use std::sync::Arc;

Expand Down Expand Up @@ -224,7 +223,7 @@ fn mine_reorg() {
let genesis = pow::mine_genesis_block().unwrap();
{
// Create chain that reports last block status
let mut last_status = RwLock::new(None);
let last_status = RwLock::new(None);
let adapter = Arc::new(StatusAdapter::new(last_status));
let chain = setup_with_status_adapter(DIR_NAME, genesis.clone(), adapter.clone());

Expand Down
2 changes: 1 addition & 1 deletion chain/tests/test_coinbase_maturity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use self::core::libtx::{self, build};
use self::core::pow::Difficulty;
use self::core::{consensus, pow};
use self::keychain::{ExtKeychain, ExtKeychainPath, Keychain};
use self::util::{RwLock, StopState};
use self::util::RwLock;
use chrono::Duration;
use env_logger;
use grin_chain as chain;
Expand Down
6 changes: 3 additions & 3 deletions chain/tests/test_txhashset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn test_unexpected_zip() {
let zip_file = File::open(&zip_path).unwrap();
assert!(txhashset::zip_write(PathBuf::from(db_root.clone()), zip_file, &head).is_ok());
// Remove temp txhashset dir
fs::remove_dir_all(
let _ = fs::remove_dir_all(
Path::new(&db_root).join(format!("txhashset_zip_{}", head.hash().to_string())),
);
// Then add strange files in the original txhashset folder
Expand All @@ -64,7 +64,7 @@ fn test_unexpected_zip() {
format!("txhashset_zip_{}", head.hash().to_string()),
txhashset_zip_path.clone()
));
fs::remove_dir_all(
let _ = fs::remove_dir_all(
Path::new(&db_root).join(format!("txhashset_zip_{}", head.hash().to_string())),
);

Expand All @@ -76,7 +76,7 @@ fn test_unexpected_zip() {
"txhashset".to_string(),
txhashset_path.clone()
));
fs::remove_dir_all(Path::new(&db_root).join("txhashset"));
let _ = fs::remove_dir_all(Path::new(&db_root).join("txhashset"));
}
// Cleanup chain directory
clean_output_dir(&db_root);
Expand Down

0 comments on commit f17dd5f

Please sign in to comment.