cleared up all unwraps from the reminder sender. cleared up clippy lints. added undo button

This commit is contained in:
jude
2022-05-13 23:08:52 +01:00
parent 8bad95510d
commit 7d43aa5918
15 changed files with 318 additions and 158 deletions

View File

@ -211,14 +211,12 @@ pub async fn natural_parser(time: &str, timezone: &str) -> Option<i64> {
.output()
.await
.ok()
.map(|inner| {
.and_then(|inner| {
if inner.status.success() {
Some(from_utf8(&*inner.stdout).unwrap().parse::<i64>().unwrap())
} else {
None
}
})
.flatten()
.map(|inner| if inner < 0 { None } else { Some(inner) })
.flatten()
.and_then(|inner| if inner < 0 { None } else { Some(inner) })
}