From 0ac7a219f043d3b1c8c239089d9dd6e6c9fa830b Mon Sep 17 00:00:00 2001 From: Marvin Löbel Date: Sun, 4 Aug 2013 01:59:24 +0200 Subject: 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 --- src/libsyntax/parse/parser.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libsyntax/parse/parser.rs') 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 "" and "". - 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, -- cgit 1.4.1-3-g733a5