Skip to content

Commit

Permalink
fix: function deprecations and required macro fields
Browse files Browse the repository at this point in the history
  • Loading branch information
glindstr committed Dec 10, 2024
1 parent 2fea8b5 commit 7c49eb3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ipn_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use tide::{Body, Response, StatusCode};
use crate::azure_function::{AzureFnLogger, AzureFnLoggerExt};
use crate::{AppRequest, MailchimpQuery, MailchimpResponse};

#[allow(clippy::upper_case_acronyms)]
#[allow(clippy::upper_case_acronyms, reason = "The struct name uses a naming convention aligned with external API standards")]
#[derive(Debug, Deserialize)]
struct IPNTransationMessage {
txn_id: String,
Expand All @@ -27,7 +27,7 @@ struct IPNTransationMessage {
transaction_subject: Option<String>,
}

#[allow(clippy::upper_case_acronyms)]
#[allow(clippy::upper_case_acronyms, reason = "The struct name uses a naming convention aligned with external API standards")]
#[derive(Debug, Deserialize)]
struct IPNMessageTypeOnly {
txn_type: Option<String>,
Expand Down Expand Up @@ -254,8 +254,8 @@ pub async fn ipn_handler(mut req: AppRequest) -> tide::Result<Response> {
if let Ok(existing_expire_day) =
NaiveDate::parse_from_str(&mc_json.merge_fields.expires, "%Y-%m-%d")
{
let existing_expire = existing_expire_day.and_hms(12, 0, 0);
let existing_expire = DateTime::from_utc(existing_expire, Utc);
let existing_expire = existing_expire_day.and_hms_opt(12, 0, 0).expect("Failed to create a NaiveDateTime with the given date and time.");
let existing_expire = DateTime::from_naive_utc_and_offset(existing_expire, Utc);
if existing_expire > utc_expires {
info!(
logger,
Expand Down

0 comments on commit 7c49eb3

Please sign in to comment.