Skip to content

Commit

Permalink
refactor locales and share more byte writing code
Browse files Browse the repository at this point in the history
  • Loading branch information
conradludgate committed Oct 16, 2022
1 parent 117e07d commit c23831b
Show file tree
Hide file tree
Showing 4 changed files with 225 additions and 255 deletions.
6 changes: 4 additions & 2 deletions src/date.rs
Expand Up @@ -532,7 +532,8 @@ impl<Tz: TimeZone> Sub<Date<Tz>> for Date<Tz> {

impl<Tz: TimeZone> fmt::Debug for Date<Tz> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?}{:?}", self.naive_local(), self.offset)
self.naive_local().write_into(f)?;
fmt::Debug::fmt(&self.offset, f)
}
}

Expand All @@ -541,7 +542,8 @@ where
Tz::Offset: fmt::Display,
{
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}{}", self.naive_local(), self.offset)
self.naive_local().write_into(f)?;
fmt::Display::fmt(&self.offset, f)
}
}

Expand Down

0 comments on commit c23831b

Please sign in to comment.