diff options
| author | Graydon Hoare <[email protected]> | 2010-09-20 23:56:43 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-09-20 23:56:43 -0700 |
| commit | c5f4789d5b75d3098665b17d318144cb7c54f42a (patch) | |
| tree | 2d0ef3ef0e85aa7f2453d8bae762c89552a99ed9 /src/lib/util.rs | |
| parent | Wrap long lines. (diff) | |
| download | rust-c5f4789d5b75d3098665b17d318144cb7c54f42a.tar.xz rust-c5f4789d5b75d3098665b17d318144cb7c54f42a.zip | |
Bind pattern slots with ?, drop parens from 0-ary tag constructors, translate 0-ary constructors as constants. Rustc loses ~300kb.
Diffstat (limited to 'src/lib/util.rs')
| -rw-r--r-- | src/lib/util.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/util.rs b/src/lib/util.rs index dee93773..9b55d89a 100644 --- a/src/lib/util.rs +++ b/src/lib/util.rs @@ -1,5 +1,5 @@ tag option[T] { - none(); + none; some(T); } @@ -7,11 +7,11 @@ 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)) { + case (some[T](?x)) { ret some[U](f(x)); } - case (none[T]()) { - ret none[U](); + case (none[T]) { + ret none[U]; } } } |