Skip to content

Instantly share code, notes, and snippets.

@wunki
Created June 30, 2014 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wunki/0ea7bb008d337e6e9e64 to your computer and use it in GitHub Desktop.
Save wunki/0ea7bb008d337e6e9e64 to your computer and use it in GitHub Desktop.
extern crate crypto = "rust-crypto";
use std::os;
struct Keys {
AccessKey: String,
SecretKey: String,
}
pub fn env_keys() -> Option<Keys> {
let access_key = match os::getenv("AWS_ACCESS_KEY_ID") {
Some(v) => v,
None => return None,
};
let secret_key = match os::getenv("AWS_SECRET_ACCESS_KEY") {
Some(v) => v,
None => return None,
};
let keys = Keys {
AccessKey: access_key,
SecretKey: secret_key,
};
Some(keys)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment