cargo fmt

This commit is contained in:
2026-04-14 03:13:36 +09:00
parent 7ec6e88605
commit a0a9df11c0
45 changed files with 389 additions and 351 deletions
+5 -5
View File
@@ -38,7 +38,10 @@ fn resolve_api_key(
if let Some(ref raw_path) = config.api_key_file {
let path = expand_key_path(raw_path, manifest_dir)?;
let contents = std::fs::read_to_string(&path).map_err(|e| {
ProviderError::Config(format!("failed to read api_key_file {}: {e}", path.display()))
ProviderError::Config(format!(
"failed to read api_key_file {}: {e}",
path.display()
))
})?;
return Ok(Some(contents.trim().to_owned()));
}
@@ -47,10 +50,7 @@ fn resolve_api_key(
}
/// Expand `~` and resolve relative paths against `manifest_dir`.
fn expand_key_path(
raw: &Path,
manifest_dir: Option<&Path>,
) -> Result<PathBuf, ProviderError> {
fn expand_key_path(raw: &Path, manifest_dir: Option<&Path>) -> Result<PathBuf, ProviderError> {
let path = if raw.starts_with("~") {
let home = std::env::var("HOME")
.map_err(|_| ProviderError::Config("HOME is not set for ~ expansion".into()))?;