agent: lumotia — pin rust toolchain + workspace clippy/fmt sweep

rust-toolchain.toml pins to stable 1.94.1 so contributors and CI runners
share the exact rustc / rustfmt / clippy versions. Without the pin, every
machine surfaces a different lint set depending on its local install — six
pre-existing lints showed up on 1.94.1 that 1.93-era HANDOVER reported clean.

Clippy fixes (all pre-existing, not introduced by feature work):

- crates/storage/src/database.rs: std::iter::repeat().take() -> repeat_n()
- crates/llm/src/lib.rs (docs): "+ frontends" was parsed as a markdown bullet
  continuation by rustdoc, breaking doc-lazy-continuation. Reworded to "and".
- crates/llm/src/lib.rs (loop): while-let-on-iterator -> for-loop.
- src-tauri/src/commands/security.rs: .iter().any(|a| *a == x) -> .contains(&x).
- src-tauri/src/lib.rs: io::Error::new(Other, e) -> io::Error::other(e).
- src-tauri/src/tauri_app_data_migration.rs: drop function-tail `return`s
  inside cfg blocks; each platform's block now ends with a tail expression.

cargo fmt sweep across the workspace. Mechanical layout-only changes;
no semantics affected.

Workspace gates after this commit:
- cargo fmt --check: clean
- cargo clippy --workspace --all-targets -- -D warnings: clean
- cargo test --workspace: 405/0 (will become 409/0 with Phase A.1+A.2)
This commit is contained in:
2026-05-14 07:19:59 +01:00
parent e4d56b831f
commit 27661c816e
24 changed files with 184 additions and 210 deletions

View File

@@ -199,8 +199,7 @@ impl LocalEngine {
let backend = guard.as_mut().ok_or(Error::EngineNotLoaded)?;
let start = Instant::now();
let segments =
backend.transcribe_sync_with_abort(audio.samples(), options, abort_flag)?;
let segments = backend.transcribe_sync_with_abort(audio.samples(), options, abort_flag)?;
let inference_ms = start.elapsed().as_millis() as u64;
Ok(TimedTranscript {
@@ -272,7 +271,9 @@ pub fn load_whisper(model_path: &Path) -> Result<Box<dyn Transcriber + Send>> {
mod tests {
use super::*;
use std::sync::atomic::Ordering;
use transcribe_rs::{ModelCapabilities, TranscribeError, TranscribeOptions, TranscriptionResult};
use transcribe_rs::{
ModelCapabilities, TranscribeError, TranscribeOptions, TranscriptionResult,
};
#[test]
fn engine_reports_not_available_before_loading() {

View File

@@ -130,10 +130,7 @@ fn verified_manifest_path(dir: &Path) -> PathBuf {
dir.join(".lumotia-verified")
}
fn verified_manifest_matches(
entry: &lumotia_core::model_registry::ModelEntry,
dir: &Path,
) -> bool {
fn verified_manifest_matches(entry: &lumotia_core::model_registry::ModelEntry, dir: &Path) -> bool {
let manifest = match std::fs::read_to_string(verified_manifest_path(dir)) {
Ok(contents) => contents,
Err(_) => return false,
@@ -760,10 +757,7 @@ mod tests {
manifest_path.exists(),
"final manifest must exist after atomic write"
);
assert!(
!tmp_path.exists(),
"stale .tmp must be removed by rename"
);
assert!(!tmp_path.exists(), "stale .tmp must be removed by rename");
let body = std::fs::read_to_string(&manifest_path).unwrap();
assert!(body.starts_with("version\t1"));

View File

@@ -92,9 +92,7 @@ impl WhisperRsBackend {
);
let mut state = self.ctx.create_state().map_err(|e| {
Error::TranscriptionFailed(
WhisperBackendError::State(e.to_string()).to_string(),
)
Error::TranscriptionFailed(WhisperBackendError::State(e.to_string()).to_string())
})?;
let mut params = FullParams::new(SamplingStrategy::Greedy { best_of: 1 });
@@ -124,9 +122,7 @@ impl WhisperRsBackend {
}
state.full(params, samples).map_err(|e| {
Error::TranscriptionFailed(
WhisperBackendError::Transcribe(e.to_string()).to_string(),
)
Error::TranscriptionFailed(WhisperBackendError::Transcribe(e.to_string()).to_string())
})?;
let n = state.full_n_segments();