Skip to content

Commit 2d20a84

Browse files
committed
tools/memcached_benchmark: format files with new rustfmt config
Signed-off-by: Ruowen Qin <ruowenq2@illinois.edu>
1 parent 41a6d23 commit 2d20a84

File tree

6 files changed

+31
-27
lines changed

6 files changed

+31
-27
lines changed

tools/memcached_benchmark/src/dict.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
use std::{collections::HashMap, mem::size_of_val, sync::Arc};
1+
use std::collections::HashMap;
2+
use std::mem::size_of_val;
3+
use std::sync::Arc;
24

35
use log::{debug, info};
4-
use rand::{
5-
Rng,
6-
distr::{Alphanumeric, SampleString},
7-
};
8-
use rand_chacha::{ChaCha8Rng, rand_core::SeedableRng};
6+
use rand::Rng;
7+
use rand::distr::{Alphanumeric, SampleString};
8+
use rand_chacha::ChaCha8Rng;
9+
use rand_chacha::rand_core::SeedableRng;
910
use rand_distr::Zipf;
1011
use rayon::prelude::*;
1112

12-
use crate::{Protocol, fs::write_hashmap_to_file};
13+
use crate::Protocol;
14+
use crate::fs::write_hashmap_to_file;
1315

1416
const SEED: u64 = 12312;
1517

tools/memcached_benchmark/src/fs.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
use std::{
2-
collections::HashMap,
3-
fs::File,
4-
io::{BufRead, BufReader, Write},
5-
path::Path,
6-
};
1+
use std::collections::HashMap;
2+
use std::fs::File;
3+
use std::io::{BufRead, BufReader, Write};
4+
use std::path::Path;
75

86
use anyhow::Result;
97
use log::{debug, info};

tools/memcached_benchmark/src/get_values.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
use std::{
2-
collections::HashMap,
3-
sync::{Arc, atomic::*},
4-
};
1+
use std::collections::HashMap;
2+
use std::sync::Arc;
3+
use std::sync::atomic::*;
54

65
use anyhow::Result;
76
use async_memcached::AsciiProtocol;
87
use clap::ValueEnum;
98
use log::{info, trace};
109
use serde::{Deserialize, Serialize};
11-
use tokio::{net::UdpSocket, sync::mpsc, time::timeout};
10+
use tokio::net::UdpSocket;
11+
use tokio::sync::mpsc;
12+
use tokio::time::timeout;
1213
use tokio_util::task::TaskTracker;
1314

1415
use crate::{BUFFER_SIZE, TIMEOUT_COUNTER};

tools/memcached_benchmark/src/main.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ mod fs;
66
mod get_values;
77
mod set_values;
88

9-
use std::{
10-
collections::HashMap,
11-
sync::{Arc, atomic::*},
12-
vec,
13-
};
9+
use std::collections::HashMap;
10+
use std::sync::Arc;
11+
use std::sync::atomic::*;
12+
use std::vec;
1413

1514
use anyhow::{Result, anyhow};
1615
use clap::Parser;

tools/memcached_benchmark/src/set_values.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
use std::{collections::HashMap, sync::Arc};
1+
use std::collections::HashMap;
2+
use std::sync::Arc;
23

34
use anyhow::Result;
45
use async_memcached::AsciiProtocol;
56
use log::info;
6-
use tokio::{sync::Semaphore, task::JoinSet};
7+
use tokio::sync::Semaphore;
8+
use tokio::task::JoinSet;
79

810
pub(super) async fn set_memcached_value(
911
test_dict: Arc<HashMap<Arc<String>, Arc<String>>>,

tools/memcached_benchmark/tests/benchmark_test.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
use std::{thread, time::Duration};
1+
use std::thread;
2+
use std::time::Duration;
23

34
use anyhow::{Ok, Result};
4-
use assert_cmd::{Command, assert::OutputAssertExt};
5+
use assert_cmd::Command;
6+
use assert_cmd::assert::OutputAssertExt;
57
use duct::{Handle, cmd};
68
use log::{debug, info};
79
use tempfile::TempDir;

0 commit comments

Comments
 (0)