Skip to content

Commit

Permalink
style: fix cargo fmt warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Centaurus99 committed Mar 4, 2024
1 parent c837213 commit c339e0e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion rattan-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ fn main() {
let output = handle.wait_with_output().unwrap();
let stdout = String::from_utf8(output.stdout).unwrap();
stdout.contains("time=")
}; match res {
};
match res {
true => {
info!("ping test passed");
left_ns.enter().unwrap();
Expand Down
3 changes: 2 additions & 1 deletion rattan/src/metal/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ where
std::mem::size_of::<sockaddr_ll>() as u32,
))
}
}; match res {
};
match res {
Ok(_) => break,
Err(e) => {
times -= 1;
Expand Down
1 change: 0 additions & 1 deletion rattan/tests/external/af_packet.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// This test need to be run as root (CAP_NET_ADMIN, CAP_SYS_ADMIN and CAP_SYS_RAW)
/// CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER='sudo -E' cargo test af_packet -- --ignored --nocapture
use libc::{c_void, size_t, sockaddr, sockaddr_ll, socklen_t};
use nix::errno::Errno;
use nix::sys::epoll::{epoll_create, epoll_ctl, epoll_wait, EpollEvent, EpollFlags};
Expand Down
5 changes: 4 additions & 1 deletion rattan/tests/integration/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ fn test_http() {
info!(left_delay_rx, left_delay_tx);
let (right_delay_rx, right_delay_tx) = machine.add_device(right_delay_device);
info!(right_delay_rx, right_delay_tx);
if delay_control_tx.send((left_delay_tx, right_delay_tx)).is_err() {
if delay_control_tx
.send((left_delay_tx, right_delay_tx))
.is_err()
{
error!("send control interface failed");
}
let (left_loss_rx, left_loss_tx) = machine.add_device(left_loss_device);
Expand Down
5 changes: 4 additions & 1 deletion rattan/tests/integration/loss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ fn test_iid_loss() {
let right_loss_device = IIDLossDevice::<StdPacket, StdRng>::new(rng);
let left_control_interface = left_loss_device.control_interface();
let right_control_interface = right_loss_device.control_interface();
if control_tx.send((left_control_interface, right_control_interface)).is_err() {
if control_tx
.send((left_control_interface, right_control_interface))
.is_err()
{
error!("send control interface failed");
}
let left_device = VirtualEthernet::<StdPacket, AfPacketDriver>::new(
Expand Down

0 comments on commit c339e0e

Please sign in to comment.