Skip to content

Commit 70665b7

Browse files
authored
fix: Clippy lints (#1)
1 parent b937f0a commit 70665b7

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

client/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ pub struct StorageId {
4242
id: String,
4343
}
4444
impl StorageId {
45-
pub fn from_str(id: &str) -> Self {
46-
Self { id: id.into() }
45+
pub fn new(id: String) -> Self {
46+
Self { id }
4747
}
4848
}
4949

50-
static MOCK_STORAGE: LazyLock<Mutex<HashMap<(&'static str, StorageScope, StorageId), Arc<[u8]>>>> =
50+
type StorageKey = (&'static str, StorageScope, StorageId);
51+
52+
static MOCK_STORAGE: LazyLock<Mutex<HashMap<StorageKey, Arc<[u8]>>>> =
5153
LazyLock::new(Default::default);
5254

5355
pub struct StorageClient {

service/src/datamodel.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(unused)]
2+
13
pub enum Compression {
24
None,
35
Zstd,

stresstest/src/raw_seaweed.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ impl SeaweedClient {
4848
if payload.len == 0 {
4949
return Poll::Ready(None);
5050
}
51-
let mut read_buf = Vec::with_capacity(1024 * 1024);
52-
read_buf.resize(1024 * 1024, 0);
51+
let mut read_buf = vec![0; 1024 * 1024];
5352
let read_len = payload.read(&mut read_buf).unwrap();
5453
read_buf.truncate(read_len);
5554

@@ -97,7 +96,7 @@ impl SeaweedClient {
9796
let mut expected_payload = Vec::new();
9897
payload.read_to_end(&mut expected_payload).unwrap();
9998

100-
if file_contents != &expected_payload {
99+
if file_contents != expected_payload {
101100
panic!("readback mismatch?");
102101
}
103102
}

stresstest/src/workload.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl WorkloadBuilder {
5454

5555
let size_distribution = LogNormal::new(mu, sigma).unwrap();
5656
let action_distribution =
57-
WeightedIndex::new(&[self.write_weight, self.read_weight, self.delete_weight]).unwrap();
57+
WeightedIndex::new([self.write_weight, self.read_weight, self.delete_weight]).unwrap();
5858

5959
Workload {
6060
name: self.name,

0 commit comments

Comments
 (0)