Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
vvp committed Jul 6, 2023
1 parent bb6c259 commit 9165fab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 2 additions & 5 deletions node/narwhal/src/gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -837,10 +837,7 @@ pub mod gateway_tests {
pub fn to_gateway(&self) -> Gateway<N> {
let committee = self.committee_input.to_committee().unwrap();
let account = self.node_validator.get_account();
let dev = match self.dev {
None => None,
Some(dev) => Some(dev as u16),
};
let dev = self.dev.map(|dev| dev as u16);
Gateway::new(Arc::new(RwLock::new(committee)), account, dev).unwrap()
}

Expand Down Expand Up @@ -913,7 +910,7 @@ pub mod gateway_tests {
assert_eq!(gateway.num_workers(), workers.len() as u8);
}
Err(err) => {
panic!("Shouldn't fail because of {err}");
unreachable!("Unexpected {err}");
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions node/narwhal/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,9 @@ impl<N: Network> Worker<N> {

#[cfg(test)]
mod worker_tests {
use crate::{gateway_tests::GatewayInput, helpers::storage_tests::StorageInput, Gateway, Worker, MAX_WORKERS};
use snarkvm::prelude::Testnet3;
use crate::helpers::storage_tests::StorageInput;
use test_strategy::Arbitrary;

type N = Testnet3;

#[derive(Arbitrary, Debug, Clone)]
pub struct WorkerInput {
pub id: u8,
Expand Down

0 comments on commit 9165fab

Please sign in to comment.