Fixing warnings
This commit is contained in:
@@ -364,7 +364,7 @@ mod tests {
|
||||
fn reopen_fork() {
|
||||
let mut dir = ::std::env::temp_dir();
|
||||
dir.push(H32::random().hex());
|
||||
let (foo, bar, baz) = {
|
||||
let (foo, _bar, _baz) = {
|
||||
let mut jdb = ArchiveDB::new(dir.to_str().unwrap());
|
||||
// history is 1
|
||||
let foo = jdb.insert(b"foo");
|
||||
|
||||
@@ -120,9 +120,15 @@ impl AccountProvider for AccountService {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for AccountService {
|
||||
fn default() -> Self {
|
||||
AccountService::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl AccountService {
|
||||
/// New account service with the default location
|
||||
pub fn new() -> AccountService {
|
||||
pub fn new() -> Self {
|
||||
let secret_store = RwLock::new(SecretStore::new());
|
||||
secret_store.write().unwrap().try_import_existing();
|
||||
AccountService {
|
||||
@@ -568,7 +574,7 @@ mod tests {
|
||||
let temp = RandomTempPath::create_dir();
|
||||
let mut sstore = SecretStore::new_test(&temp);
|
||||
let addr = sstore.new_account("test").unwrap();
|
||||
let _ok = sstore.unlock_account(&addr, "test").unwrap();
|
||||
sstore.unlock_account(&addr, "test").unwrap();
|
||||
let secret = sstore.account_secret(&addr).unwrap();
|
||||
let kp = KeyPair::from_secret(secret).unwrap();
|
||||
assert_eq!(Address::from(kp.public().sha3()), addr);
|
||||
|
||||
@@ -160,12 +160,12 @@ impl Connection {
|
||||
}
|
||||
}
|
||||
|
||||
/// Get socket token
|
||||
/// Get socket token
|
||||
pub fn token(&self) -> StreamToken {
|
||||
self.token
|
||||
}
|
||||
|
||||
/// Replace socket token
|
||||
/// Replace socket token
|
||||
pub fn set_token(&mut self, token: StreamToken) {
|
||||
self.token = token;
|
||||
}
|
||||
@@ -261,13 +261,13 @@ pub struct EncryptedConnection {
|
||||
}
|
||||
|
||||
impl EncryptedConnection {
|
||||
|
||||
/// Get socket token
|
||||
|
||||
/// Get socket token
|
||||
pub fn token(&self) -> StreamToken {
|
||||
self.connection.token
|
||||
}
|
||||
|
||||
/// Replace socket token
|
||||
/// Replace socket token
|
||||
pub fn set_token(&mut self, token: StreamToken) {
|
||||
self.connection.set_token(token);
|
||||
}
|
||||
@@ -513,8 +513,14 @@ mod tests {
|
||||
buf_size: usize,
|
||||
}
|
||||
|
||||
impl Default for TestSocket {
|
||||
fn default() -> Self {
|
||||
TestSocket::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl TestSocket {
|
||||
fn new() -> TestSocket {
|
||||
fn new() -> Self {
|
||||
TestSocket {
|
||||
read_buffer: vec![],
|
||||
write_buffer: vec![],
|
||||
@@ -593,8 +599,14 @@ mod tests {
|
||||
|
||||
type TestConnection = GenericConnection<TestSocket>;
|
||||
|
||||
impl Default for TestConnection {
|
||||
fn default() -> Self {
|
||||
TestConnection::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl TestConnection {
|
||||
pub fn new() -> TestConnection {
|
||||
pub fn new() -> Self {
|
||||
TestConnection {
|
||||
token: 999998888usize,
|
||||
socket: TestSocket::new(),
|
||||
@@ -609,8 +621,14 @@ mod tests {
|
||||
|
||||
type TestBrokenConnection = GenericConnection<TestBrokenSocket>;
|
||||
|
||||
impl Default for TestBrokenConnection {
|
||||
fn default() -> Self {
|
||||
TestBrokenConnection::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl TestBrokenConnection {
|
||||
pub fn new() -> TestBrokenConnection {
|
||||
pub fn new() -> Self {
|
||||
TestBrokenConnection {
|
||||
token: 999998888usize,
|
||||
socket: TestBrokenSocket { error: "test broken socket".to_owned() },
|
||||
|
||||
Reference in New Issue
Block a user