We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2662d2 commit c74f6eaCopy full SHA for c74f6ea
src/timezone.rs
@@ -6,13 +6,14 @@ use chrono::offset::FixedOffset;
6
///
7
/// The additional `colon` may be used to parse a mandatory or optional `:` between hours and minutes,
8
/// and should return a valid `FixedOffset` or `Err` when parsing fails.
9
+#[inline]
10
pub fn parse(s: &str) -> Result<FixedOffset> {
- let offset = if s.contains(':') {
11
+ FixedOffset::east_opt(if s.contains(':') {
12
parse_offset_internal(s, colon_or_space, false)?
13
} else {
14
parse_offset_2822(s)?
- };
15
- FixedOffset::east_opt(offset).ok_or_else(|| anyhow!("input is out of range"))
+ })
16
+ .ok_or_else(|| anyhow!("input is out of range"))
17
}
18
19
#[inline]
0 commit comments