diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2014-12-08 13:28:32 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2014-12-13 17:03:47 -0500 |
| commit | 0dac05dd627612232403c07ca8bd6d3376eec64a (patch) | |
| tree | 656a23a7314866c8fa5cc6ca787111db41d90834 /src/libsyntax/codemap.rs | |
| parent | 2160427900ea675e494274d42a8d8485724f440e (diff) | |
| download | rust-0dac05dd627612232403c07ca8bd6d3376eec64a.tar.gz rust-0dac05dd627612232403c07ca8bd6d3376eec64a.zip | |
libsyntax: use unboxed closures
Diffstat (limited to 'src/libsyntax/codemap.rs')
| -rw-r--r-- | src/libsyntax/codemap.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 7f2becf8201..d2fe667339c 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -568,7 +568,9 @@ impl CodeMap { ExpnId(expansions.len().to_u32().expect("too many ExpnInfo's!") - 1) } - pub fn with_expn_info<T>(&self, id: ExpnId, f: |Option<&ExpnInfo>| -> T) -> T { + pub fn with_expn_info<T, F>(&self, id: ExpnId, f: F) -> T where + F: FnOnce(Option<&ExpnInfo>) -> T, + { match id { NO_EXPANSION => f(None), ExpnId(i) => f(Some(&(*self.expansions.borrow())[i as uint])) |
