summaryrefslogtreecommitdiffstats
path: root/src/timetype.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/timetype.rs')
-rw-r--r--src/timetype.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/timetype.rs b/src/timetype.rs
index 6725edd..fa6fe11 100644
--- a/src/timetype.rs
+++ b/src/timetype.rs
@@ -438,6 +438,19 @@ impl TimeType {
}
+/// Helper trait for converting things into a TimeType object
+///
+/// Until `TryInto` is stabilized in Rust, we need a helper trait for this.
+pub trait IntoTimeType {
+ fn into_timetype(self) -> Result<TimeType>;
+}
+
+impl IntoTimeType for TimeType {
+ fn into_timetype(self) -> Result<TimeType> {
+ Ok(self)
+ }
+}
+
fn do_calculate(tt: TimeType) -> Result<TimeType> {
use timetype::TimeType as TT;