Skip to content

Commit 8fe69fe

Browse files
committed
style: format imports
Signed-off-by: Martin Kröning <[email protected]>
1 parent 26bad28 commit 8fe69fe

File tree

20 files changed

+57
-72
lines changed

20 files changed

+57
-72
lines changed

benches/alloc/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ SOFTWARE.
3131

3232
#![feature(slice_ptr_get)]
3333

34-
#[cfg(target_os = "hermit")]
35-
use hermit as _;
36-
3734
use std::alloc::{alloc, dealloc, Layout};
3835
use std::time::Instant;
3936

37+
#[cfg(target_os = "hermit")]
38+
use hermit as _;
39+
4040
const BENCH_DURATION: f64 = 3.0;
4141

4242
fn main() {

benches/micro/src/benches/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
use std::env;
21
use std::f64::consts::{E, PI};
32
use std::ffi::c_void;
43
use std::fs::File;
54
use std::hint::black_box;
6-
use std::io::Read;
7-
use std::io::Write;
5+
use std::io::{Read, Write};
86
use std::net::{TcpListener, TcpStream};
9-
use std::str;
10-
use std::thread;
117
use std::time::Instant;
12-
use std::vec;
8+
use std::{env, str, thread, vec};
139

1410
extern "C" {
1511
pub fn memcpy(dest: *mut c_void, src: *const c_void, n: usize) -> *mut c_void;

benches/netbench/src/connection.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
use crate::config::Config;
21
use std::io;
32
use std::io::ErrorKind::WouldBlock;
43
use std::io::{Read, Write};
5-
use std::net::Shutdown;
6-
use std::net::TcpListener;
7-
use std::net::TcpStream;
8-
use std::net::ToSocketAddrs;
4+
use std::net::{Shutdown, TcpListener, TcpStream, ToSocketAddrs};
5+
6+
use crate::config::Config;
97

108
/// Sends first n_bytes from wbuf using the given stream.
119
/// Make sure wbuf.len >= n_bytes

benches/netbench/src/rust-tcp-bw/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#![allow(unused_imports)]
22

3-
#[cfg(target_os = "hermit")]
4-
use hermit as _;
3+
use std::io::{self, Write};
54

65
use clap::Parser;
6+
#[cfg(target_os = "hermit")]
7+
use hermit as _;
78
use rust_tcp_io_perf::config::Config;
89
use rust_tcp_io_perf::connection;
9-
use std::io::{self, Write};
1010

1111
fn main() {
1212
let args = Config::parse();

benches/netbench/src/rust-tcp-bw/server.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#![allow(unused_imports)]
22

3-
#[cfg(target_os = "hermit")]
4-
use hermit as _;
3+
use std::io::Read;
4+
use std::time::Instant;
55

66
use clap::Parser;
7+
#[cfg(target_os = "hermit")]
8+
use hermit as _;
79
use rust_tcp_io_perf::config::Config;
8-
use rust_tcp_io_perf::connection;
9-
use rust_tcp_io_perf::print_utils;
10-
use std::io::Read;
11-
use std::time::Instant;
10+
use rust_tcp_io_perf::{connection, print_utils};
1211

1312
fn main() {
1413
let args = Config::parse();

benches/netbench/src/rust-tcp-latency/client.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
#![allow(unused_imports)]
22

3-
#[cfg(target_os = "hermit")]
4-
use hermit as _;
3+
use std::time::Instant;
4+
use std::{thread, time};
55

66
use clap::Parser;
7+
#[cfg(target_os = "hermit")]
8+
use hermit as _;
79
use rust_tcp_io_perf::config::Config;
8-
use rust_tcp_io_perf::connection;
9-
use rust_tcp_io_perf::print_utils;
10-
use rust_tcp_io_perf::threading;
11-
use std::time::Instant;
12-
use std::{thread, time};
10+
use rust_tcp_io_perf::{connection, print_utils, threading};
1311

1412
fn main() {
1513
let args = Config::parse();

benches/netbench/src/rust-tcp-latency/server.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#![allow(unused_imports)]
22

3+
use clap::Parser;
34
#[cfg(target_os = "hermit")]
45
use hermit as _;
5-
6-
use clap::Parser;
76
use rust_tcp_io_perf::config::Config;
8-
use rust_tcp_io_perf::connection;
9-
use rust_tcp_io_perf::threading;
7+
use rust_tcp_io_perf::{connection, threading};
108

119
fn main() {
1210
let args = Config::parse();

examples/demo/src/tests/laplace.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use rayon::prelude::*;
21
use std::vec;
32

3+
use rayon::prelude::*;
4+
45
fn get_residual(matrix: &[f64], size_x: usize, size_y: usize) -> f64 {
56
(1..size_y - 1)
67
.into_par_iter()

examples/demo/src/tests/mod.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
#[cfg(target_arch = "aarch64")]
2-
use aarch64::regs::*;
3-
use rayon::prelude::*;
4-
use std::env;
51
use std::f64::consts::{E, PI};
62
use std::fs::File;
7-
use std::io::Read;
8-
use std::io::Write;
3+
use std::io::{Read, Write};
94
use std::net::{TcpListener, TcpStream};
10-
use std::str;
11-
use std::thread;
125
use std::time::{self, Instant};
13-
use std::vec;
6+
use std::{env, str, thread, vec};
7+
8+
#[cfg(target_arch = "aarch64")]
9+
use aarch64::regs::*;
10+
use rayon::prelude::*;
1411

1512
mod laplace;
1613
mod matmul;

examples/fuse_test/src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
use std::fs;
2+
use std::path::Path;
3+
14
#[cfg(target_os = "hermit")]
25
use hermit as _;
36

4-
use std::{fs, path::Path};
5-
67
#[cfg(target_os = "hermit")]
78
const TEST_DIR: &str = "/root";
89
#[cfg(not(target_os = "hermit"))]

0 commit comments

Comments
 (0)