From 12abd19c4c03533445717489d22b3e09b1f0a897 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Mon, 28 Nov 2022 13:55:03 -0500 Subject: chrono: use hms_opt --- src/commands/today/mod.rs | 2 +- src/commands/today/pianoman.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/today/mod.rs b/src/commands/today/mod.rs index 141f1af..0a5eefe 100644 --- a/src/commands/today/mod.rs +++ b/src/commands/today/mod.rs @@ -97,7 +97,7 @@ pub fn today(ctx: &mut Context, msg: &Message, _args: Args) -> Result<()> { .or_else(|_| { _args.parse::() .map(|date| { - let time = chrono::NaiveTime::from_hms(12, 0, 0); + let time = chrono::NaiveTime::from_hms_opt(12, 0, 0).unwrap(); date.and_time(time) }) }); diff --git a/src/commands/today/pianoman.rs b/src/commands/today/pianoman.rs index fa3ac7e..e3a997f 100644 --- a/src/commands/today/pianoman.rs +++ b/src/commands/today/pianoman.rs @@ -1,8 +1,8 @@ use super::prelude::*; lazy_static! { - static ref NINE_AM: chrono::NaiveTime = chrono::NaiveTime::from_hms(9, 0, 0); - static ref NINE_PM: chrono::NaiveTime = chrono::NaiveTime::from_hms(21, 0, 0); + static ref NINE_AM: chrono::NaiveTime = chrono::NaiveTime::from_hms_opt(9, 0, 0).unwrap(); + static ref NINE_PM: chrono::NaiveTime = chrono::NaiveTime::from_hms_opt(21, 0, 0).unwrap(); static ref PIANOMANS: Vec = vec![ by_url("https://www.youtube.com/watch?v=gxEPV4kolz0"), -- cgit v1.3.1