Skip to content

Commit

Permalink
fixup: Some TLC for msrv.
Browse files Browse the repository at this point in the history
  • Loading branch information
tormeh committed Mar 8, 2023
1 parent 7db6c51 commit 44f06cf
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl<Tz: TimeZone> Date<Tz> {
//
// note: this constructor is purposely not named to `new` to discourage the direct usage.
#[inline]
pub const fn from_utc(date: NaiveDate, offset: Tz::Offset) -> Date<Tz> {
pub fn from_utc(date: NaiveDate, offset: Tz::Offset) -> Date<Tz> {
Date { date, offset }
}

Expand Down Expand Up @@ -227,7 +227,7 @@ impl<Tz: TimeZone> Date<Tz> {

/// Retrieves an associated offset from UTC.
#[inline]
pub const fn offset(&self) -> &Tz::Offset {
pub fn offset(&self) -> &Tz::Offset {
&self.offset
}

Expand Down Expand Up @@ -274,7 +274,7 @@ impl<Tz: TimeZone> Date<Tz> {

/// Returns a view to the naive UTC date.
#[inline]
pub const fn naive_utc(&self) -> NaiveDate {
pub fn naive_utc(&self) -> NaiveDate {
self.date
}

Expand All @@ -284,7 +284,7 @@ impl<Tz: TimeZone> Date<Tz> {
/// because the offset is restricted to never exceed one day,
/// but provided for the consistency.
#[inline]
pub const fn naive_local(&self) -> NaiveDate {
pub fn naive_local(&self) -> NaiveDate {
self.date
}

Expand Down
6 changes: 3 additions & 3 deletions src/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl<Tz: TimeZone> DateTime<Tz> {
//
// note: this constructor is purposely not named to `new` to discourage the direct usage.
#[inline]
pub const fn from_utc(datetime: NaiveDateTime, offset: Tz::Offset) -> DateTime<Tz> {
pub fn from_utc(datetime: NaiveDateTime, offset: Tz::Offset) -> DateTime<Tz> {
DateTime { datetime, offset }
}

Expand Down Expand Up @@ -288,7 +288,7 @@ impl<Tz: TimeZone> DateTime<Tz> {

/// Retrieves an associated offset from UTC.
#[inline]
pub const fn offset(&self) -> &Tz::Offset {
pub fn offset(&self) -> &Tz::Offset {
&self.offset
}

Expand Down Expand Up @@ -380,7 +380,7 @@ impl<Tz: TimeZone> DateTime<Tz> {

/// Returns a view to the naive UTC datetime.
#[inline]
pub const fn naive_utc(&self) -> NaiveDateTime {
pub fn naive_utc(&self) -> NaiveDateTime {
self.datetime
}

Expand Down
8 changes: 2 additions & 6 deletions src/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -867,11 +867,7 @@ pub struct DelayedFormat<I> {
#[cfg(any(feature = "alloc", feature = "std", test))]
impl<'a, I: Iterator<Item = B> + Clone, B: Borrow<Item<'a>>> DelayedFormat<I> {
/// Makes a new `DelayedFormat` value out of local date and time.
pub const fn new(
date: Option<NaiveDate>,
time: Option<NaiveTime>,
items: I,
) -> DelayedFormat<I> {
pub fn new(date: Option<NaiveDate>, time: Option<NaiveTime>, items: I) -> DelayedFormat<I> {
DelayedFormat {
date,
time,
Expand Down Expand Up @@ -906,7 +902,7 @@ impl<'a, I: Iterator<Item = B> + Clone, B: Borrow<Item<'a>>> DelayedFormat<I> {
/// Makes a new `DelayedFormat` value out of local date and time and locale.
#[cfg(feature = "unstable-locales")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))]
pub const fn new_with_locale(
pub fn new_with_locale(
date: Option<NaiveDate>,
time: Option<NaiveTime>,
items: I,
Expand Down
4 changes: 2 additions & 2 deletions src/naive/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ impl NaiveDate {
#[cfg(any(feature = "alloc", feature = "std", test))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))]
#[inline]
pub const fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat<I>
pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat<I>
where
I: Iterator<Item = B> + Clone,
B: Borrow<Item<'a>>,
Expand Down Expand Up @@ -1150,7 +1150,7 @@ impl NaiveDate {
#[cfg(feature = "unstable-locales")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))]
#[inline]
pub const fn format_localized_with_items<'a, I, B>(
pub fn format_localized_with_items<'a, I, B>(
&self,
items: I,
locale: Locale,
Expand Down
2 changes: 1 addition & 1 deletion src/naive/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ impl NaiveDateTime {
#[cfg(any(feature = "alloc", feature = "std", test))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))]
#[inline]
pub const fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat<I>
pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat<I>
where
I: Iterator<Item = B> + Clone,
B: Borrow<Item<'a>>,
Expand Down
2 changes: 1 addition & 1 deletion src/naive/datetime/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ enum SerdeError<V: fmt::Display, D: fmt::Display> {
}

/// Construct a [`SerdeError::NonExistent`]
const fn ne_timestamp<T: fmt::Display>(ts: T) -> SerdeError<T, u8> {
fn ne_timestamp<T: fmt::Display>(ts: T) -> SerdeError<T, u8> {
SerdeError::NonExistent::<T, u8> { timestamp: ts }
}

Expand Down
2 changes: 1 addition & 1 deletion src/naive/time/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ impl NaiveTime {
#[cfg(any(feature = "alloc", feature = "std", test))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))]
#[inline]
pub const fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat<I>
pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat<I>
where
I: Iterator<Item = B> + Clone,
B: Borrow<Item<'a>>,
Expand Down

0 comments on commit 44f06cf

Please sign in to comment.