diff options
| author | Lindsey Kuper <[email protected]> | 2011-03-18 12:32:54 -0700 |
|---|---|---|
| committer | Lindsey Kuper <[email protected]> | 2011-03-18 12:32:54 -0700 |
| commit | 6dee1ac161a22a4bc1e49c5dac3c7bbba1ff97f0 (patch) | |
| tree | f423d576e977e7a258f09e50e5a51702525782e2 /src/lib/option.rs | |
| parent | Ignore emacs autosave files. (diff) | |
| parent | rustc: Add a span_unimpl() for debugging (diff) | |
| download | rust-6dee1ac161a22a4bc1e49c5dac3c7bbba1ff97f0.tar.xz rust-6dee1ac161a22a4bc1e49c5dac3c7bbba1ff97f0.zip | |
Merge branch 'master' of git://github.com/graydon/rust
Diffstat (limited to 'src/lib/option.rs')
| -rw-r--r-- | src/lib/option.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/option.rs b/src/lib/option.rs index 25f82b52..29a6f6eb 100644 --- a/src/lib/option.rs +++ b/src/lib/option.rs @@ -31,6 +31,13 @@ fn map[T, U](&operator[T, U] f, &t[T] opt) -> t[U] { fail; // FIXME: remove me when exhaustiveness checking works } +fn is_none[T](&t[T] opt) -> bool { + alt (opt) { + case (none[T]) { ret true; } + case (some[T](_)) { ret false; } + } +} + // Local Variables: // mode: rust; // fill-column: 78; |