(key: &str)
| 484 | } |
| 485 | |
| 486 | fn 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)] |
| 495 | fn read_api_key() -> Result<String, ApiError> { |
no outgoing calls
no test coverage detected