more commands. fixed an issue with text only commands

This commit is contained in:
2021-09-11 00:14:23 +01:00
parent 471948bed3
commit 9b5333dc87
18 changed files with 562 additions and 897 deletions

View File

@ -10,9 +10,8 @@ pub fn longhand_displacement(seconds: u64) -> String {
let mut sections = vec![];
for (var, name) in [days, hours, minutes, seconds]
.iter()
.zip(["days", "hours", "minutes", "seconds"].iter())
for (var, name) in
[days, hours, minutes, seconds].iter().zip(["days", "hours", "minutes", "seconds"].iter())
{
if *var > 0 {
sections.push(format!("{} {}", var, name));
@ -26,14 +25,7 @@ pub fn generate_uid() -> String {
let mut generator: OsRng = Default::default();
(0..64)
.map(|_| {
CHARACTERS
.chars()
.choose(&mut generator)
.unwrap()
.to_owned()
.to_string()
})
.map(|_| CHARACTERS.chars().choose(&mut generator).unwrap().to_owned().to_string())
.collect::<Vec<String>>()
.join("")
}