Skip to content

Commit b4c86de

Browse files
committed
fix: simplify using Davids suggestion
1 parent 00e68b7 commit b4c86de

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/input/datetime.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,9 @@ impl<'a> EitherTimedelta<'a> {
129129
let microseconds: f64 = f64::from(py_timedelta.get_microseconds()); // 0 through 999999
130130
Ok(86400.0 * days + seconds + microseconds / 1_000_000.0)
131131
}
132-
Self::PySubclass(py_timedelta) => {
133-
let total_seconds: f64 = py_timedelta
134-
.call_method0(intern!(py_timedelta.py(), "total_seconds"))?
135-
.extract()?;
136-
Ok(total_seconds)
137-
}
132+
Self::PySubclass(py_timedelta) => py_timedelta
133+
.call_method0(intern!(py_timedelta.py(), "total_seconds"))?
134+
.extract(),
138135
}
139136
}
140137
}

0 commit comments

Comments
 (0)