Created
April 2, 2017 19:26
-
-
Save mike-engel/aa4c7c981107f0fedd626ec3667375c7 to your computer and use it in GitHub Desktop.
lifetimes are hard :(
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[macro_use] | |
extern crate lazy_static; | |
use std::fs::File; | |
use std::io::prelude::*; | |
use std::collections::HashSet; | |
use std::iter::FromIterator; | |
lazy_static! { | |
static ref PASSWORDS: HashSet<&'static str> = { | |
let mut f = File::open("common-passwords.txt") | |
.expect("There was a problem opening the list of passwords"); | |
let mut file_contents = String::new(); | |
f.read_to_string(&mut file_contents) | |
.expect("There was a problem reading the common passwords file"); | |
HashSet::from_iter(file_contents.lines()) | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error output