style(src-tauri): cargo fmt
Pure mechanical rustfmt reformat (default config, no rustfmt.toml).
This commit is contained in:
@@ -7,14 +7,18 @@ use std::path::{Path, PathBuf};
|
||||
const ENV_VAR: &str = "VOICED_SELFTEST_OUT";
|
||||
|
||||
fn configured_path() -> Option<PathBuf> {
|
||||
std::env::var_os(ENV_VAR).filter(|v| !v.is_empty()).map(PathBuf::from)
|
||||
std::env::var_os(ENV_VAR)
|
||||
.filter(|v| !v.is_empty())
|
||||
.map(PathBuf::from)
|
||||
}
|
||||
|
||||
fn write_report(path: &Path, json: &str) -> Result<(), String> {
|
||||
if let Some(parent) = path.parent() {
|
||||
std::fs::create_dir_all(parent).map_err(|e| format!("Could not create {}: {e}", parent.display()))?;
|
||||
std::fs::create_dir_all(parent)
|
||||
.map_err(|e| format!("Could not create {}: {e}", parent.display()))?;
|
||||
}
|
||||
let mut file = std::fs::File::create(path).map_err(|e| format!("Could not write the report: {e}"))?;
|
||||
let mut file =
|
||||
std::fs::File::create(path).map_err(|e| format!("Could not write the report: {e}"))?;
|
||||
file.write_all(json.as_bytes())
|
||||
.and_then(|()| file.sync_all())
|
||||
.map_err(|e| format!("Could not write the report: {e}"))
|
||||
|
||||
Reference in New Issue
Block a user