mirror of
https://github.com/chronotope/chrono.git
synced 2025-10-02 15:26:12 +00:00
Make write_rfc3339
available in no_std
This commit is contained in:
parent
2cc1db1dae
commit
5f80aafe0d
@ -10,19 +10,17 @@ use core::borrow::Borrow;
|
||||
use core::fmt;
|
||||
use core::fmt::Write;
|
||||
|
||||
use crate::datetime::SecondsFormat;
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
use crate::naive::{NaiveDate, NaiveDateTime, NaiveTime};
|
||||
use crate::offset::Offset;
|
||||
use crate::{Datelike, FixedOffset, NaiveDateTime, Timelike};
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
use crate::offset::{FixedOffset, Offset};
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
use crate::{Datelike, SecondsFormat, Timelike, Weekday};
|
||||
use crate::{NaiveDate, NaiveTime, Weekday};
|
||||
|
||||
use super::locales;
|
||||
use super::{Colons, OffsetFormat, OffsetPrecision, Pad};
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
use super::{
|
||||
Colons, Fixed, InternalFixed, InternalInternal, Item, Locale, Numeric, OffsetFormat,
|
||||
OffsetPrecision, Pad,
|
||||
};
|
||||
use super::{Fixed, InternalFixed, InternalInternal, Item, Locale, Numeric};
|
||||
use locales::*;
|
||||
|
||||
/// A *temporary* object which can be used as an argument to `format!` or others.
|
||||
@ -447,7 +445,6 @@ fn format_inner(
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
impl OffsetFormat {
|
||||
/// Writes an offset from UTC with the format defined by `self`.
|
||||
fn format(&self, w: &mut impl Write, off: FixedOffset) -> fmt::Result {
|
||||
@ -528,7 +525,6 @@ impl OffsetFormat {
|
||||
}
|
||||
|
||||
/// Writes the date, time and offset to the string. same as `%Y-%m-%dT%H:%M:%S%.f%:z`
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
#[inline]
|
||||
pub(crate) fn write_rfc3339(
|
||||
w: &mut impl Write,
|
||||
|
@ -52,11 +52,12 @@ pub(crate) mod locales;
|
||||
|
||||
pub(crate) use formatting::write_hundreds;
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
pub(crate) use formatting::write_rfc2822;
|
||||
pub(crate) use formatting::write_rfc3339;
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
pub use formatting::{format, format_item, DelayedFormat};
|
||||
#[cfg(feature = "unstable-locales")]
|
||||
pub use formatting::{format_item_localized, format_localized};
|
||||
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||
pub(crate) use formatting::{write_rfc2822, write_rfc3339};
|
||||
#[cfg(feature = "unstable-locales")]
|
||||
pub use locales::Locale;
|
||||
#[cfg(not(feature = "unstable-locales"))]
|
||||
|
Loading…
x
Reference in New Issue
Block a user