about summary refs log tree commit diff
path: root/src/libsyntax/ext/source_util.rs
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/ext/source_util.rs
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/ext/source_util.rs')
-rw-r--r--src/libsyntax/ext/source_util.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs
index 626a562b92c..71903b9aa02 100644
--- a/src/libsyntax/ext/source_util.rs
+++ b/src/libsyntax/ext/source_util.rs
@@ -31,7 +31,7 @@ pub fn expand_line(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     base::check_zero_tts(cx, sp, tts, "line!");
 
-    let topmost = topmost_expn_info(cx.backtrace().get());
+    let topmost = topmost_expn_info(cx.backtrace().unwrap());
     let loc = cx.codemap().lookup_char_pos(topmost.call_site.lo);
 
     base::MRExpr(cx.expr_uint(topmost.call_site, loc.line))
@@ -42,7 +42,7 @@ pub fn expand_col(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     base::check_zero_tts(cx, sp, tts, "col!");
 
-    let topmost = topmost_expn_info(cx.backtrace().get());
+    let topmost = topmost_expn_info(cx.backtrace().unwrap());
     let loc = cx.codemap().lookup_char_pos(topmost.call_site.lo);
     base::MRExpr(cx.expr_uint(topmost.call_site, loc.col.to_uint()))
 }
@@ -54,7 +54,7 @@ pub fn expand_file(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     base::check_zero_tts(cx, sp, tts, "file!");
 
-    let topmost = topmost_expn_info(cx.backtrace().get());
+    let topmost = topmost_expn_info(cx.backtrace().unwrap());
     let loc = cx.codemap().lookup_char_pos(topmost.call_site.lo);
     let filename = loc.file.name;
     base::MRExpr(cx.expr_str(topmost.call_site, filename))