Skip to content

Instantly share code, notes, and snippets.

@softprops
Created February 7, 2017 04:04
Show Gist options
  • Save softprops/01595e903d6f889fe14ee5ea008c47e8 to your computer and use it in GitHub Desktop.
Save softprops/01595e903d6f889fe14ee5ea008c47e8 to your computer and use it in GitHub Desktop.
extern crate envy;
use std::env;
#[derive(Deserialize, Debug)]
struct Config {
secret: String,
coolfactor: f32,
prize: Option<usize>
}
fn main() {
match envy::from_env::<Config>() {
Ok(config) => println!("{:#?}", config)
Err(error) => panic!("{:#?}", error)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment