Skip to main content

load_with_default

Function load_with_default 

Source
pub fn load_with_default<T: FromEnvStr>(
    key: &str,
    default: &str,
) -> Result<T, String>
Expand description

Read an env var and parse it into T, falling back to default when the variable is absent.

Returns Err if parsing fails on either the env var value or the default.