libstd: Change all uses of &fn(A)->B over to |A|->B in libstd

This commit is contained in:
Patrick Walton
2013-11-18 21:15:42 -08:00
parent eef913b290
commit 1946265e1a
58 changed files with 270 additions and 236 deletions

View File

@@ -203,7 +203,7 @@ impl<T> RcMut<T> {
impl<T> RcMut<T> {
/// Fails if there is already a mutable borrow of the box
#[inline]
pub fn with_borrow<U>(&self, f: &fn(&T) -> U) -> U {
pub fn with_borrow<U>(&self, f: |&T| -> U) -> U {
unsafe {
assert!((*self.ptr).borrow != Mutable);
let previous = (*self.ptr).borrow;
@@ -216,7 +216,7 @@ impl<T> RcMut<T> {
/// Fails if there is already a mutable or immutable borrow of the box
#[inline]
pub fn with_mut_borrow<U>(&self, f: &fn(&mut T) -> U) -> U {
pub fn with_mut_borrow<U>(&self, f: |&mut T| -> U) -> U {
unsafe {
assert_eq!((*self.ptr).borrow, Nothing);
(*self.ptr).borrow = Mutable;