diff --git a/src/libcollections/range.rs b/src/libcollections/range.rs index 06ddcd13d55..92716538147 100644 --- a/src/libcollections/range.rs +++ b/src/libcollections/range.rs @@ -91,3 +91,21 @@ impl RangeArgument for Range { Excluded(&self.end) } } + +impl RangeArgument for (Bound, Bound) { + fn start(&self) -> Bound<&T> { + match *self { + (Included(ref start), _) => Included(start), + (Excluded(ref start), _) => Excluded(start), + (Unbounded, _) => Unbounded, + } + } + + fn end(&self) -> Bound<&T> { + match *self { + (_, Included(ref end)) => Included(end), + (_, Excluded(ref end)) => Excluded(end), + (_, Unbounded) => Unbounded, + } + } +}