Defer offset response #2

Merged
jude merged 1 commits from jude/fix-offset into current 2023-11-06 17:35:28 +00:00
2 changed files with 3 additions and 1 deletions
Showing only changes of commit adb9c728f4 - Show all commits

View File

@ -1,6 +1,6 @@
[package] [package]
name = "reminder-rs" name = "reminder-rs"
version = "1.6.47" version = "1.6.48"
authors = ["Jude Southworth <judesouthworth@pm.me>"] authors = ["Jude Southworth <judesouthworth@pm.me>"]
edition = "2021" edition = "2021"
license = "AGPL-3.0 only" license = "AGPL-3.0 only"

View File

@ -114,6 +114,8 @@ pub async fn offset(
#[description = "Number of minutes to offset by"] minutes: Option<isize>, #[description = "Number of minutes to offset by"] minutes: Option<isize>,
#[description = "Number of seconds to offset by"] seconds: Option<isize>, #[description = "Number of seconds to offset by"] seconds: Option<isize>,
) -> Result<(), Error> { ) -> Result<(), Error> {
ctx.defer().await?;
let combined_time = hours.map_or(0, |h| h * HOUR as isize) let combined_time = hours.map_or(0, |h| h * HOUR as isize)
+ minutes.map_or(0, |m| m * MINUTE as isize) + minutes.map_or(0, |m| m * MINUTE as isize)
+ seconds.map_or(0, |s| s); + seconds.map_or(0, |s| s);