1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#[cfg(not(feature = "std"))]
use alloc::{borrow::ToOwned, string::String};
#[allow(clippy::missing_docs_in_private_items)]
#[cfg_attr(__time_02_supports_non_exhaustive, non_exhaustive)]
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Format {
#[cfg_attr(__time_02_docs, doc(alias = "ISO8601"))]
Rfc3339,
Custom(String),
#[cfg(not(__time_02_supports_non_exhaustive))]
#[doc(hidden)]
__NonExhaustive,
}
impl<T: AsRef<str>> From<T> for Format {
fn from(s: T) -> Self {
Format::Custom(s.as_ref().to_owned())
}
}