about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorMarvin Löbel <loebel.marvin@gmail.com>2013-08-04 01:59:24 +0200
committerMarvin Löbel <loebel.marvin@gmail.com>2013-08-05 22:42:21 +0200
commit0ac7a219f043d3b1c8c239089d9dd6e6c9fa830b (patch)
tree6dbb028659dbc0931ec23398e529549c84bba0a4 /src/libsyntax/parse
parentd8b299d179653cbde783f62f70b5531dbaa5c5a6 (diff)
downloadrust-0ac7a219f043d3b1c8c239089d9dd6e6c9fa830b.tar.gz
rust-0ac7a219f043d3b1c8c239089d9dd6e6c9fa830b.zip
Updated std::Option, std::Either and std::Result
- Made naming schemes consistent between Option, Result and Either
- Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None)
- Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index afa2e7a5e42..a0932729930 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -691,7 +691,7 @@ impl Parser {
         */
 
         let opt_abis = self.parse_opt_abis();
-        let abis = opt_abis.get_or_default(AbiSet::Rust());
+        let abis = opt_abis.unwrap_or_default(AbiSet::Rust());
         let purity = self.parse_unsafety();
         self.expect_keyword(keywords::Fn);
         let (decl, lifetimes) = self.parse_ty_fn_decl();
@@ -3326,7 +3326,7 @@ impl Parser {
         let ident = self.parse_ident();
         let opt_bounds = self.parse_optional_ty_param_bounds();
         // For typarams we don't care about the difference b/w "<T>" and "<T:>".
-        let bounds = opt_bounds.get_or_default(opt_vec::Empty);
+        let bounds = opt_bounds.unwrap_or_default(opt_vec::Empty);
         ast::TyParam { ident: ident, id: self.get_id(), bounds: bounds }
     }
 
@@ -4196,7 +4196,7 @@ impl Parser {
                 self.obsolete(*self.last_span, ObsoleteExternVisibility);
             }
 
-            let abis = opt_abis.get_or_default(AbiSet::C());
+            let abis = opt_abis.unwrap_or_default(AbiSet::C());
 
             let (inner, next) = self.parse_inner_attrs_and_next();
             let m = self.parse_foreign_mod_items(sort, abis, next);
@@ -4463,7 +4463,7 @@ impl Parser {
 
             if self.eat_keyword(keywords::Fn) {
                 // EXTERN FUNCTION ITEM
-                let abis = opt_abis.get_or_default(AbiSet::C());
+                let abis = opt_abis.unwrap_or_default(AbiSet::C());
                 let (ident, item_, extra_attrs) =
                     self.parse_item_fn(extern_fn, abis);
                 return iovi_item(self.mk_item(lo, self.last_span.hi, ident,