Skip to content

Commit 231c59b

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 164770 b: refs/heads/try c: f56f972 h: refs/heads/master v: v3
1 parent ab90b49 commit 231c59b

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: f8f2c7a9537c7f333b242f616aefb75a83860927
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 8443b09e361b96d1f9b7f45a65ed0d31c0e86e70
5-
refs/heads/try: c7b6eb38ff14b7225b7ccb86f9a2080fdba4a3e0
5+
refs/heads/try: f56f9728e626886a89be852e642b84be7be36ab8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcore/slice.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,15 +1725,17 @@ pub mod raw {
17251725
use mem::transmute;
17261726
use ptr::RawPtr;
17271727
use raw::Slice;
1728+
use ops::FnOnce;
17281729
use option::Option;
17291730
use option::Option::{None, Some};
17301731

17311732
/// Form a slice from a pointer and length (as a number of units,
17321733
/// not bytes).
17331734
#[inline]
17341735
#[deprecated = "renamed to slice::from_raw_buf"]
1735-
pub unsafe fn buf_as_slice<T,U>(p: *const T, len: uint, f: |v: &[T]| -> U)
1736-
-> U {
1736+
pub unsafe fn buf_as_slice<T, U, F>(p: *const T, len: uint, f: F) -> U where
1737+
F: FnOnce(&[T]) -> U,
1738+
{
17371739
f(transmute(Slice {
17381740
data: p,
17391741
len: len
@@ -1744,12 +1746,9 @@ pub mod raw {
17441746
/// not bytes).
17451747
#[inline]
17461748
#[deprecated = "renamed to slice::from_raw_mut_buf"]
1747-
pub unsafe fn mut_buf_as_slice<T,
1748-
U>(
1749-
p: *mut T,
1750-
len: uint,
1751-
f: |v: &mut [T]| -> U)
1752-
-> U {
1749+
pub unsafe fn mut_buf_as_slice<T, U, F>(p: *mut T, len: uint, f: F) -> U where
1750+
F: FnOnce(&mut [T]) -> U,
1751+
{
17531752
f(transmute(Slice {
17541753
data: p as *const T,
17551754
len: len

0 commit comments

Comments
 (0)