stdlib: Add Result and Option types
Since the type checker sucks less now, we can think about maybe adding some features to the language. ...At some point I'd like to have the type checker clean up the index map.
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
//! Iterable ranges
|
||||
|
||||
type T = _;
|
||||
|
||||
/// An Exclusive Range `a .. b` iterates from a to b, excluding b
|
||||
// #[lang = "range_exc", T]
|
||||
pub struct RangeExc(T, T)
|
||||
// #[lang = "range_exc"]
|
||||
pub struct RangeExc<T>(T, T)
|
||||
|
||||
/// An Inclusive Range `a ..= b` iterates from a to b, including b
|
||||
// #[lang = "range_inc", T]
|
||||
pub struct RangeInc(T, T)
|
||||
// #[lang = "range_inc"]
|
||||
pub struct RangeInc<T>(T, T)
|
||||
|
||||
impl RangeExc {
|
||||
fn next(this: &RangeInc) -> T {
|
||||
fn next<T>(this: &RangeExc) -> T {
|
||||
(*this).0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user