From 492677ec1e4e66a57a2fce78962db2f89932dd74 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 19 Nov 2013 12:21:21 -0800 Subject: libsyntax: Change all uses of `&fn` to `||`. --- src/libsyntax/parse/lexer.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/libsyntax/parse/lexer.rs') diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 06a2c557e42..26de9215dbf 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -216,16 +216,22 @@ fn byte_offset(rdr: &StringReader, pos: BytePos) -> BytePos { /// Calls `f` with a string slice of the source text spanning from `start` /// up to but excluding `rdr.last_pos`, meaning the slice does not include /// the character `rdr.curr`. -pub fn with_str_from(rdr: @mut StringReader, start: BytePos, f: &fn(s: &str) -> T) -> T { +pub fn with_str_from( + rdr: @mut StringReader, + start: BytePos, + f: |s: &str| -> T) + -> T { with_str_from_to(rdr, start, rdr.last_pos, f) } /// Calls `f` with astring slice of the source text spanning from `start` /// up to but excluding `end`. -fn with_str_from_to(rdr: @mut StringReader, - start: BytePos, - end: BytePos, - f: &fn(s: &str) -> T) -> T { +fn with_str_from_to( + rdr: @mut StringReader, + start: BytePos, + end: BytePos, + f: |s: &str| -> T) + -> T { f(rdr.src.slice( byte_offset(rdr, start).to_uint(), byte_offset(rdr, end).to_uint())) -- cgit 1.4.1-3-g733a5