Skip to content

Commit 2560100

Browse files
committed
fix(lint): satisfy release clippy checks
Remove unused reconciliation snapshot code and apply the small Clippy simplifications needed for the documented release validation to pass with -D warnings. Agent: codex
1 parent d2934a3 commit 2560100

5 files changed

Lines changed: 5 additions & 34 deletions

File tree

rust/crates/pumas-core/src/api/models.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ impl PumasApi {
362362
) -> Vec<model_library::ImportPathClassification> {
363363
paths
364364
.iter()
365-
.map(|path| model_library::classify_import_path(path))
365+
.map(model_library::classify_import_path)
366366
.collect()
367367
}
368368

rust/crates/pumas-core/src/api/reconciliation.rs

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,6 @@ struct ReconciliationState {
5151
models: HashMap<String, ScopeRuntimeState>,
5252
}
5353

54-
/// Runtime snapshot exposed to status responses.
55-
#[derive(Debug, Clone, Default)]
56-
pub(crate) struct ReconciliationStatusSnapshot {
57-
pub all_in_flight: bool,
58-
pub model_in_flight_count: usize,
59-
pub dirty_all: bool,
60-
pub dirty_model_count: usize,
61-
pub last_all_reconciled_at: Option<String>,
62-
pub model_cooldown_seconds: u64,
63-
}
64-
6554
/// Internal coordinator for throttled, single-flight reconciliation.
6655
pub(crate) struct ReconciliationCoordinator {
6756
state: Mutex<ReconciliationState>,
@@ -152,21 +141,6 @@ impl ReconciliationCoordinator {
152141
}
153142
}
154143

155-
pub(crate) async fn snapshot(&self) -> ReconciliationStatusSnapshot {
156-
let state = self.state.lock().await;
157-
ReconciliationStatusSnapshot {
158-
all_in_flight: state.all.in_flight,
159-
model_in_flight_count: state.models.values().filter(|s| s.in_flight).count(),
160-
dirty_all: has_unreconciled_dirty(&state.all),
161-
dirty_model_count: state
162-
.models
163-
.values()
164-
.filter(|s| has_unreconciled_dirty(s))
165-
.count(),
166-
last_all_reconciled_at: state.all.last_checked_rfc3339.clone(),
167-
model_cooldown_seconds: self.model_cooldown.as_secs(),
168-
}
169-
}
170144
}
171145

172146
fn has_unreconciled_dirty(scope_state: &ScopeRuntimeState) -> bool {
@@ -533,9 +507,7 @@ async fn fetch_expected_files_from_hf(primary: &PrimaryState, repo_id: &str) ->
533507
}
534508

535509
async fn fetch_model_kind_from_hf(primary: &PrimaryState, repo_id: &str) -> Option<String> {
536-
let Some(ref client) = primary.hf_client else {
537-
return None;
538-
};
510+
let client = primary.hf_client.as_ref()?;
539511

540512
match client.get_model_info(repo_id).await {
541513
Ok(model) => {

rust/crates/pumas-core/src/model_library/directory_import.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ fn merge_candidates(
415415
left
416416
}
417417

418-
fn sort_candidates(candidates: &mut Vec<ImportPathCandidate>) {
418+
fn sort_candidates(candidates: &mut [ImportPathCandidate]) {
419419
candidates.sort_by(|left, right| left.path.cmp(&right.path));
420420
}
421421

rust/crates/pumas-core/src/model_library/hf/search.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,7 @@ impl HuggingFaceClient {
513513
let normalized = tag
514514
.trim()
515515
.to_lowercase()
516-
.replace(' ', "-")
517-
.replace('_', "-");
516+
.replace([' ', '_'], "-");
518517
match normalized.as_str() {
519518
"text-ranking" | "text-reranking" | "reranking" => {
520519
return Some("text-ranking".to_string());

rust/crates/pumas-rpc/src/handlers/models/imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ pub async fn get_library_model_metadata(
314314
metadata
315315
.entry_path
316316
.as_deref()
317-
.or_else(|| primary_file_str.as_deref())
317+
.or(primary_file_str.as_deref())
318318
.map(std::path::Path::new)
319319
})
320320
.and_then(get_diffusers_component_manifest);

0 commit comments

Comments
 (0)