1 2 3 4 5 6 7 8 9 10 11 12 13
use std::env::VarError; pub fn get_api_token() -> Result<String, VarError> { std::env::var("ACCESS_TOKEN") } pub fn validate_api_token(token: &str) -> Result<(), VarError> { if token.is_empty() { Err(VarError::NotPresent) } else { Ok(()) } }