Remove unused dependencies, slightly optimise release binary size
This commit is contained in:
parent
22f5e257a9
commit
caa8c3568d
3 changed files with 13 additions and 75 deletions
12
src/io.rs
12
src/io.rs
|
@ -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>()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue