chore: apply formatter updates
This commit is contained in:
1 parent
8f754b3f00
commit
b111ae0a76
5 files changed
+110
-97
No files matched your search
@@ -18,7 +18,10 @@ serde_json = "1"
|
||||
tauri = { version = "2", features = ["tray-icon", "image-png"] }
|
||||
tauri-plugin-opener = "2"
|
||||
tauri-plugin-global-shortcut = "2"
|
||||
reqwest = { version = "0.12", default-features = false, features = ["blocking", "rustls-tls"] }
|
||||
reqwest = { version = "0.12", default-features = false, features = [
|
||||
"blocking",
|
||||
"rustls-tls",
|
||||
] }
|
||||
cpal = "0.15.3"
|
||||
hound = "3.5"
|
||||
arboard = "3.6"
|
||||
|
||||
@@ -87,7 +87,8 @@ pub fn status_for_path(path: &Path, expected_size: u64) -> ModelInstallStatus {
|
||||
Ok(metadata) if metadata.len() >= expected_size => ModelInstallStatus::Ready,
|
||||
Ok(metadata) => ModelInstallStatus::Error(format!(
|
||||
"arquivo incompleto: {} de {} bytes",
|
||||
metadata.len(), expected_size
|
||||
metadata.len(),
|
||||
expected_size
|
||||
)),
|
||||
Err(_) => ModelInstallStatus::NotInstalled,
|
||||
}
|
||||
@@ -132,7 +133,8 @@ pub fn download_default_model(model_dir: &Path) -> AppResult<ModelDownloadResult
|
||||
bytes_written += read as u64;
|
||||
}
|
||||
|
||||
file.flush().map_err(|error| AppError::Io(error.to_string()))?;
|
||||
file.flush()
|
||||
.map_err(|error| AppError::Io(error.to_string()))?;
|
||||
|
||||
if bytes_written < model.size_bytes {
|
||||
let _ = fs::remove_file(&temp_path);
|
||||
@@ -180,9 +182,12 @@ mod tests {
|
||||
fs::write(&path, [1_u8, 2, 3, 4]).unwrap_or_else(|error| panic!("write model: {error}"));
|
||||
|
||||
assert_eq!(status_for_path(&path, 4), ModelInstallStatus::Ready);
|
||||
assert!(matches!(status_for_path(&path, 5), ModelInstallStatus::Error(_)));
|
||||
assert!(matches!(
|
||||
status_for_path(&path, 5),
|
||||
ModelInstallStatus::Error(_)
|
||||
));
|
||||
|
||||
let _ = fs::remove_file(path);
|
||||
let _ = fs::remove_dir(dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user