Reformat tiff.rs and reorder imports and remove unused imports
This commit is contained in:
parent
5c1446df00
commit
d5df9f6f6d
12
src/tiff.rs
12
src/tiff.rs
|
@ -24,10 +24,10 @@
|
|||
// SUCH DAMAGE.
|
||||
//
|
||||
|
||||
use core::cmp::{max,min};
|
||||
use mutate_once::MutOnce;
|
||||
use std::fmt;
|
||||
|
||||
use mutate_once::MutOnce;
|
||||
|
||||
use crate::endian::{BigEndian, Endian, LittleEndian};
|
||||
use crate::error::Error;
|
||||
use crate::tag::{Context, Tag, UnitPiece};
|
||||
|
@ -488,8 +488,12 @@ impl core::convert::TryFrom<&DateTime> for time::OffsetDateTime {
|
|||
|
||||
fn try_from(value: &DateTime) -> core::result::Result<Self, Self::Error> {
|
||||
let naive = time::PrimitiveDateTime::new(
|
||||
time::Date::from_calendar_date(value.year as i32, core::convert::TryFrom::try_from(max(min(value.month, 12), 1)).unwrap(), value.day)
|
||||
.map_err(|_| ())?,
|
||||
time::Date::from_calendar_date(
|
||||
value.year as i32,
|
||||
core::convert::TryFrom::try_from(max(min(value.month, 12), 1)).unwrap(),
|
||||
value.day,
|
||||
)
|
||||
.map_err(|_| ())?,
|
||||
time::Time::from_hms_nano(
|
||||
value.hour,
|
||||
value.minute,
|
||||
|
|
Loading…
Reference in New Issue