Remove unused dependencies, slightly optimise release binary size

This commit is contained in:
Jordan Johnson-Doyle
2019-02-16 18:05:06 +00:00
parent 22f5e257a9
commit caa8c3568d
3 changed files with 13 additions and 75 deletions

View File

@@ -41,13 +41,11 @@ fn purge_old() {
/// Generates a 'pronounceable' random ID using gpw
pub fn generate_id() -> String {
thread_local!(static KEYGEN: RefCell<gpw::PasswordGenerator> = RefCell::new(gpw::PasswordGenerator::default()));
KEYGEN.with(|k| {
k.borrow_mut().next().unwrap_or_else(|| {
thread_rng()
.sample_iter(&Alphanumeric)
.take(6)
.collect::<String>()
})
KEYGEN.with(|k| k.borrow_mut().next()).unwrap_or_else(|| {
thread_rng()
.sample_iter(&Alphanumeric)
.take(6)
.collect::<String>()
})
}