MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / read_env_non_empty

Function read_env_non_empty

claw-code/rust/crates/api/src/client.rs:486–492  ·  view source on GitHub ↗
(key: &str)

Source from the content-addressed store, hash-verified

484}
485
486fn read_env_non_empty(key: &str) -> Result<Option<String>, ApiError> {
487 match std::env::var(key) {
488 Ok(value) if !value.is_empty() => Ok(Some(value)),
489 Ok(_) | Err(std::env::VarError::NotPresent) => Ok(None),
490 Err(error) => Err(ApiError::from(error)),
491 }
492}
493
494#[cfg(test)]
495fn read_api_key() -> Result<String, ApiError> {

Callers 4

from_envMethod · 0.85
from_env_or_savedMethod · 0.85
read_auth_tokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected