Skip to content

Commit 49bd909

Browse files
committed
fix(clippy): resolve clippy warnings
- Add #[allow(dead_code)] for get_model_schema (future use) - Replace or_insert_with with or_default() (4 instances) Fixes CI clippy errors.
1 parent f182635 commit 49bd909

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

src/config/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ impl NyroConfig {
248248
Ok(())
249249
}
250250

251+
#[allow(dead_code)]
251252
pub fn get_model_schema(&self, model_name: &str) -> Option<&ModelSchema> {
252253
self.models.get(model_name)
253254
}

src/storage/mod.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,8 @@ impl LogStorage {
158158
} else {
159159
value.to_string()
160160
};
161-
let field_idx = self
162-
.secondary_indices
163-
.entry(field.clone())
164-
.or_insert_with(DashMap::new);
165-
field_idx.entry(value_str).or_insert_with(Vec::new).push(id);
161+
let field_idx = self.secondary_indices.entry(field.clone()).or_default();
162+
field_idx.entry(value_str).or_default().push(id);
166163
}
167164
}
168165
}
@@ -260,11 +257,9 @@ impl LogStorage {
260257
} else {
261258
value.to_string()
262259
};
263-
let field_idx = self
264-
.secondary_indices
265-
.entry(field.clone())
266-
.or_insert_with(DashMap::new);
267-
field_idx.entry(value_str).or_insert_with(Vec::new).push(id);
260+
let field_idx =
261+
self.secondary_indices.entry(field.clone()).or_default();
262+
field_idx.entry(value_str).or_default().push(id);
268263
}
269264
}
270265
}

0 commit comments

Comments
 (0)