mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Fix chrono warnings
This commit is contained in:
@@ -25,8 +25,8 @@ enum UpdateLogCommand {
|
|||||||
|
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
struct UpdateLogCallbackData {
|
struct UpdateLogCallbackData {
|
||||||
from: Date<Utc>,
|
from: NaiveDate,
|
||||||
to: Date<Utc>,
|
to: NaiveDate,
|
||||||
page: u32,
|
page: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,8 +45,8 @@ impl FromStr for UpdateLogCallbackData {
|
|||||||
None => return Err(strum::ParseError::VariantNotFound),
|
None => return Err(strum::ParseError::VariantNotFound),
|
||||||
};
|
};
|
||||||
|
|
||||||
let from: Date<Utc> = parse(&caps["from"]).unwrap().date();
|
let from: NaiveDate = parse(&caps["from"]).unwrap().date_naive();
|
||||||
let to: Date<Utc> = parse(&caps["to"]).unwrap().date();
|
let to: NaiveDate = parse(&caps["to"]).unwrap().date_naive();
|
||||||
let page: u32 = caps["page"].parse().unwrap();
|
let page: u32 = caps["page"].parse().unwrap();
|
||||||
|
|
||||||
Ok(UpdateLogCallbackData { from, to, page })
|
Ok(UpdateLogCallbackData { from, to, page })
|
||||||
@@ -78,7 +78,7 @@ impl GetPaginationCallbackData for UpdateLogCallbackData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn update_log_command(message: Message, bot: AutoSend<Bot>) -> BotHandlerInternal {
|
async fn update_log_command(message: Message, bot: AutoSend<Bot>) -> BotHandlerInternal {
|
||||||
let now = Utc::today();
|
let now = Utc::now().date_naive();
|
||||||
let d3 = now - Duration::days(3);
|
let d3 = now - Duration::days(3);
|
||||||
let d7 = now - Duration::days(7);
|
let d7 = now - Duration::days(7);
|
||||||
let d30 = now - Duration::days(30);
|
let d30 = now - Duration::days(30);
|
||||||
|
|||||||
Reference in New Issue
Block a user