diff options
| author | Patrick Walton <[email protected]> | 2010-11-03 17:10:37 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2010-11-05 10:23:22 -0700 |
| commit | 1d214b4df3013a53e50d778fa921ed99bc498d02 (patch) | |
| tree | c87006304b72bd7fec9962afac5370de4e2d57bd /src/lib/util.rs | |
| parent | Fix buggy while and do-while translation in rustc. Add test. (diff) | |
| download | rust-1d214b4df3013a53e50d778fa921ed99bc498d02.tar.xz rust-1d214b4df3013a53e50d778fa921ed99bc498d02.zip | |
Move the option type to its own module
Diffstat (limited to 'src/lib/util.rs')
| -rw-r--r-- | src/lib/util.rs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/lib/util.rs b/src/lib/util.rs index f6e1327b..72844d5f 100644 --- a/src/lib/util.rs +++ b/src/lib/util.rs @@ -1,21 +1,3 @@ -tag option[T] { - none; - some(T); -} - -type operator[T, U] = fn(&T) -> U; - -fn option_map[T, U](&operator[T, U] f, &option[T] opt) -> option[U] { - alt (opt) { - case (some[T](?x)) { - ret some[U](f(x)); - } - case (none[T]) { - ret none[U]; - } - } -} - fn id[T](&T x) -> T { ret x; } |