style(rust-bridge): rustfmt the secrets source

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Yujong Lee 2026-11-04 13:44:06 +09:00
parent b74bd81eda
commit 4351906ca7
2 changed files with 15 additions and 8 deletions

View file

@ -23,12 +23,11 @@ use crate::python_settings::missing_module;
pub(crate) fn source(py: Python<'_>) -> PyResult<Arc<dyn SecretSource>> {
match PythonSecrets::new(py) {
Ok(secrets) => Ok(Arc::new(secrets)),
Err(error) if missing_module(py, &error, "litellm")? => Ok(Arc::new(
EnvironmentSecrets::python_compatible(crate::http::host_client(
py,
litellm_http::ClientVariant::Provider,
)?),
)),
Err(error) if missing_module(py, &error, "litellm")? => {
Ok(Arc::new(EnvironmentSecrets::python_compatible(
crate::http::host_client(py, litellm_http::ClientVariant::Provider)?,
)))
}
Err(error) => Err(error),
}
}

View file

@ -46,7 +46,12 @@ impl PythonSecrets {
PyTuple::new(py, names)
.and_then(|names| read_secrets.bind(py).call1((names,)))
.and_then(|values| values.extract::<Vec<Option<String>>>())
.map(|values| values.into_iter().map(|value| value.map(SecretValue::new)).collect())
.map(|values| {
values
.into_iter()
.map(|value| value.map(SecretValue::new))
.collect()
})
.map_err(|error| external_error(py, error))
})
.await
@ -196,7 +201,10 @@ def read_secrets(names):
.await
.unwrap();
assert_eq!(resolved.get("MISTRAL_API_KEY").as_deref(), Some("vault-key"));
assert_eq!(
resolved.get("MISTRAL_API_KEY").as_deref(),
Some("vault-key")
);
assert_eq!(resolved.get("OTHER"), None);
assert_eq!(
resolved.get("MISTRAL_API_BASE").as_deref(),