stdlib: Add Option and Result types
This commit is contained in:
parent
09fdb14d79
commit
6108d66b0a
@ -3,7 +3,9 @@
|
|||||||
pub mod preamble {
|
pub mod preamble {
|
||||||
pub use super::{
|
pub use super::{
|
||||||
num::*,
|
num::*,
|
||||||
|
option::Option,
|
||||||
range::{RangeExc, RangeInc},
|
range::{RangeExc, RangeInc},
|
||||||
|
result::Result,
|
||||||
str::str,
|
str::str,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
//! The optional type, representing the presence or absence of a thing.
|
//! The optional type, representing the presence or absence of a thing.
|
||||||
|
use super::preamble::*;
|
||||||
|
|
||||||
pub enum Option<T> {
|
pub enum Option<T> {
|
||||||
Some(T),
|
Some(T),
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
//! The Result type, indicating a fallible operation.
|
//! The Result type, indicating a fallible operation.
|
||||||
|
use super::preamble::*;
|
||||||
|
|
||||||
pub enum Result<T, E> {
|
pub enum Result<T, E> {
|
||||||
Ok(T),
|
Ok(T),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user