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/print/pprust.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libsyntax/print') diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 174b0f8e451..f517179f603 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -874,7 +874,7 @@ pub fn print_attribute(s: @ps, attr: &ast::Attribute) { hardbreak_if_not_bol(s); maybe_print_comment(s, attr.span.lo); if attr.node.is_sugared_doc { - let comment = attr.value_str().get(); + let comment = attr.value_str().unwrap(); word(s.s, comment); } else { word(s.s, "#["); @@ -1085,7 +1085,7 @@ pub fn print_call_post(s: @ps, } if sugar != ast::NoSugar { nbsp(s); - match blk.get().node { + match blk.unwrap().node { // need to handle closures specifically ast::expr_do_body(e) => { end(s); // we close our head box; closure @@ -1095,7 +1095,7 @@ pub fn print_call_post(s: @ps, } _ => { // not sure if this can happen. - print_expr(s, blk.get()); + print_expr(s, blk.unwrap()); } } } @@ -1323,13 +1323,13 @@ pub fn print_expr(s: @ps, expr: &ast::expr) { assert!(body.stmts.is_empty()); assert!(body.expr.is_some()); // we extract the block, so as not to create another set of boxes - match body.expr.get().node { + match body.expr.unwrap().node { ast::expr_block(ref blk) => { print_block_unclosed(s, blk); } _ => { // this is a bare expression - print_expr(s, body.expr.get()); + print_expr(s, body.expr.unwrap()); end(s); // need to close a box } } -- cgit 1.4.1-3-g733a5