Skip to content

Commit 155e8d4

Browse files
authored
Implement From<RangeFull> for Times (#155)
I just noticed this is a bit of an odd one out in the implementation. I believe RangeFull is the default so a user doesn't have to set it explicitly. But if they did just out of idle habit then there wasn't a From conversion. Not really a big thing but I just figured it would be a mildly nicer DX if `N..` `..N` and `..` all worked as arguments.
1 parent 4c79601 commit 155e8d4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/mock.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,12 @@ impl From<u64> for Times {
765765
}
766766
}
767767

768+
impl From<RangeFull> for Times {
769+
fn from(x: RangeFull) -> Self {
770+
Times(TimesEnum::Unbounded(x))
771+
}
772+
}
773+
768774
// A quick macro to help easing the implementation pain.
769775
macro_rules! impl_from_for_range {
770776
($type_name:ident) => {

0 commit comments

Comments
 (0)