Skip to content

Commit

Permalink
Rename invalid_td to invalid_time_delta
Browse files Browse the repository at this point in the history
  • Loading branch information
tosti007 committed Jan 20, 2025
1 parent b04e7ce commit f14cedd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/datetime/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ pub mod td_nanoseconds {
use core::fmt;
use serde::{de, ser};

use crate::serde::invalid_td;
use crate::serde::invalid_time_delta;
use crate::TimeDelta;

use super::NanoSecondsTimeDeltaVisitor;
Expand Down Expand Up @@ -1339,7 +1339,7 @@ pub mod td_nanoseconds {
where
E: de::Error,
{
Ok(TimeDelta::nanoseconds(value.try_into().map_err(|_| invalid_td(value))?))
Ok(TimeDelta::nanoseconds(value.try_into().map_err(|_| invalid_time_delta(value))?))
}
}
}
Expand Down Expand Up @@ -1507,7 +1507,7 @@ pub mod td_microseconds {
use core::fmt;
use serde::{de, ser};

use crate::serde::invalid_td;
use crate::serde::invalid_time_delta;
use crate::TimeDelta;

use super::MicroSecondsTimeDeltaVisitor;
Expand Down Expand Up @@ -1595,7 +1595,7 @@ pub mod td_microseconds {
where
E: de::Error,
{
Ok(TimeDelta::microseconds(value.try_into().map_err(|_| invalid_td(value))?))
Ok(TimeDelta::microseconds(value.try_into().map_err(|_| invalid_time_delta(value))?))
}
}
}
Expand Down Expand Up @@ -1763,7 +1763,7 @@ pub mod td_milliseconds {
use core::fmt;
use serde::{de, ser};

use crate::serde::invalid_td;
use crate::serde::invalid_time_delta;
use crate::TimeDelta;

use super::MilliSecondsTimeDeltaVisitor;
Expand Down Expand Up @@ -1849,7 +1849,7 @@ pub mod td_milliseconds {
where
E: de::Error,
{
Ok(TimeDelta::milliseconds(value.try_into().map_err(|_| invalid_td(value))?))
Ok(TimeDelta::milliseconds(value.try_into().map_err(|_| invalid_time_delta(value))?))
}
}
}
Expand Down Expand Up @@ -2015,7 +2015,7 @@ pub mod td_seconds {
use core::fmt;
use serde::{de, ser};

use crate::serde::invalid_td;
use crate::serde::invalid_time_delta;
use crate::TimeDelta;

use super::SecondsTimeDeltaVisitor;
Expand Down Expand Up @@ -2101,7 +2101,7 @@ pub mod td_seconds {
where
E: de::Error,
{
Ok(TimeDelta::seconds(value.try_into().map_err(|_| invalid_td(value))?))
Ok(TimeDelta::seconds(value.try_into().map_err(|_| invalid_time_delta(value))?))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ pub mod serde {
}

/// Create a custom `de::Error` with `SerdeError::InvalidTimestamp`.
pub(crate) fn invalid_td<E, T>(value: T) -> E
pub(crate) fn invalid_time_delta<E, T>(value: T) -> E
where
E: de::Error,
T: fmt::Display,
Expand Down

0 comments on commit f14cedd

Please sign in to comment.