Skip to content

Commit 403cc84

Browse files
ericktgraydon
authored andcommitted
---
yaml --- r: 40485 b: refs/heads/dist-snap c: 9539724 h: refs/heads/master i: 40483: 1c401b7 v: v3
1 parent 0de6425 commit 403cc84

File tree

10 files changed

+27
-27
lines changed

10 files changed

+27
-27
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
99
refs/heads/incoming: e90142e536c150df0d9b4b2f11352152177509b5
10-
refs/heads/dist-snap: 497a8b54b5b3f9daf0ec735d443c443ac29afeab
10+
refs/heads/dist-snap: 9539724e8bf2a0109eeff3bec9fb49309de0f5f3
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libcore/either.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ pub enum Either<T, U> {
1313
Right(U)
1414
}
1515

16-
pub fn either<T, U, V>(f_left: fn((&T)) -> V,
17-
f_right: fn((&U)) -> V, value: &Either<T, U>) -> V {
16+
pub fn either<T, U, V>(f_left: fn(&T) -> V,
17+
f_right: fn(&U) -> V, value: &Either<T, U>) -> V {
1818
/*!
1919
* Applies a function based on the given either value
2020
*

branches/dist-snap/src/libcore/os.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,11 @@ pub fn tmpdir() -> Path {
489489
}
490490
}
491491
/// Recursively walk a directory structure
492-
pub fn walk_dir(p: &Path, f: fn((&Path)) -> bool) {
492+
pub fn walk_dir(p: &Path, f: fn(&Path) -> bool) {
493493

494494
walk_dir_(p, f);
495495

496-
fn walk_dir_(p: &Path, f: fn((&Path)) -> bool) -> bool {
496+
fn walk_dir_(p: &Path, f: fn(&Path) -> bool) -> bool {
497497
let mut keepgoing = true;
498498
do list_dir(p).each |q| {
499499
let path = &p.push(*q);

branches/dist-snap/src/libcore/repr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl ReprVisitor {
140140
// Various helpers for the TyVisitor impl
141141

142142
#[inline(always)]
143-
fn get<T>(f: fn((&T))) -> bool {
143+
fn get<T>(f: fn(&T)) -> bool {
144144
unsafe {
145145
f(transmute::<*c_void,&T>(copy self.ptr));
146146
}

branches/dist-snap/src/libcore/result.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub fn chain_err<T, U, V>(
143143
* print_buf(buf)
144144
* }
145145
*/
146-
pub fn iter<T, E>(res: &Result<T, E>, f: fn((&T))) {
146+
pub fn iter<T, E>(res: &Result<T, E>, f: fn(&T)) {
147147
match *res {
148148
Ok(ref t) => f(t),
149149
Err(_) => ()
@@ -158,7 +158,7 @@ pub fn iter<T, E>(res: &Result<T, E>, f: fn((&T))) {
158158
* This function can be used to pass through a successful result while
159159
* handling an error.
160160
*/
161-
pub fn iter_err<T, E>(res: &Result<T, E>, f: fn((&E))) {
161+
pub fn iter_err<T, E>(res: &Result<T, E>, f: fn(&E)) {
162162
match *res {
163163
Ok(_) => (),
164164
Err(ref e) => f(e)
@@ -179,7 +179,7 @@ pub fn iter_err<T, E>(res: &Result<T, E>, f: fn((&E))) {
179179
* parse_bytes(buf)
180180
* }
181181
*/
182-
pub fn map<T, E: Copy, U: Copy>(res: &Result<T, E>, op: fn((&T)) -> U)
182+
pub fn map<T, E: Copy, U: Copy>(res: &Result<T, E>, op: fn(&T) -> U)
183183
-> Result<U, E> {
184184
match *res {
185185
Ok(ref t) => Ok(op(t)),
@@ -195,7 +195,7 @@ pub fn map<T, E: Copy, U: Copy>(res: &Result<T, E>, op: fn((&T)) -> U)
195195
* is immediately returned. This function can be used to pass through a
196196
* successful result while handling an error.
197197
*/
198-
pub fn map_err<T: Copy, E, F: Copy>(res: &Result<T, E>, op: fn((&E)) -> F)
198+
pub fn map_err<T: Copy, E, F: Copy>(res: &Result<T, E>, op: fn(&E) -> F)
199199
-> Result<T, F> {
200200
match *res {
201201
Ok(copy t) => Ok(t),
@@ -210,14 +210,14 @@ impl<T, E> Result<T, E> {
210210

211211
pure fn is_err() -> bool { is_err(&self) }
212212

213-
pure fn iter(f: fn((&T))) {
213+
pure fn iter(f: fn(&T)) {
214214
match self {
215215
Ok(ref t) => f(t),
216216
Err(_) => ()
217217
}
218218
}
219219

220-
fn iter_err(f: fn((&E))) {
220+
fn iter_err(f: fn(&E)) {
221221
match self {
222222
Ok(_) => (),
223223
Err(ref e) => f(e)
@@ -228,7 +228,7 @@ impl<T, E> Result<T, E> {
228228
impl<T: Copy, E> Result<T, E> {
229229
pure fn get() -> T { get(&self) }
230230

231-
fn map_err<F:Copy>(op: fn((&E)) -> F) -> Result<T,F> {
231+
fn map_err<F:Copy>(op: fn(&E) -> F) -> Result<T,F> {
232232
match self {
233233
Ok(copy t) => Ok(t),
234234
Err(ref e) => Err(op(e))
@@ -239,7 +239,7 @@ impl<T: Copy, E> Result<T, E> {
239239
impl<T, E: Copy> Result<T, E> {
240240
pure fn get_err() -> E { get_err(&self) }
241241

242-
fn map<U:Copy>(op: fn((&T)) -> U) -> Result<U,E> {
242+
fn map<U:Copy>(op: fn(&T) -> U) -> Result<U,E> {
243243
match self {
244244
Ok(ref t) => Ok(op(t)),
245245
Err(copy e) => Err(e)
@@ -277,7 +277,7 @@ impl<T: Copy, E: Copy> Result<T, E> {
277277
* }
278278
*/
279279
pub fn map_vec<T,U:Copy,V:Copy>(
280-
ts: &[T], op: fn((&T)) -> Result<V,U>) -> Result<~[V],U> {
280+
ts: &[T], op: fn(&T) -> Result<V,U>) -> Result<~[V],U> {
281281

282282
let mut vs: ~[V] = vec::with_capacity(vec::len(ts));
283283
for vec::each(ts) |t| {
@@ -290,7 +290,7 @@ pub fn map_vec<T,U:Copy,V:Copy>(
290290
}
291291

292292
pub fn map_opt<T,U:Copy,V:Copy>(
293-
o_t: &Option<T>, op: fn((&T)) -> Result<V,U>) -> Result<Option<V>,U> {
293+
o_t: &Option<T>, op: fn(&T) -> Result<V,U>) -> Result<Option<V>,U> {
294294

295295
match *o_t {
296296
None => Ok(None),
@@ -311,7 +311,7 @@ pub fn map_opt<T,U:Copy,V:Copy>(
311311
* to accommodate an error like the vectors being of different lengths.
312312
*/
313313
pub fn map_vec2<S,T,U:Copy,V:Copy>(ss: &[S], ts: &[T],
314-
op: fn((&S),(&T)) -> Result<V,U>) -> Result<~[V],U> {
314+
op: fn(&S,&T) -> Result<V,U>) -> Result<~[V],U> {
315315

316316
assert vec::same_length(ss, ts);
317317
let n = vec::len(ts);
@@ -333,7 +333,7 @@ pub fn map_vec2<S,T,U:Copy,V:Copy>(ss: &[S], ts: &[T],
333333
* on its own as no result vector is built.
334334
*/
335335
pub fn iter_vec2<S,T,U:Copy>(ss: &[S], ts: &[T],
336-
op: fn((&S),(&T)) -> Result<(),U>) -> Result<(),U> {
336+
op: fn(&S,&T) -> Result<(),U>) -> Result<(),U> {
337337

338338
assert vec::same_length(ss, ts);
339339
let n = vec::len(ts);

branches/dist-snap/src/libcore/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1845,7 +1845,7 @@ const tag_six_b: uint = 252u;
18451845
* let i = str::as_bytes("Hello World") { |bytes| vec::len(bytes) };
18461846
* ~~~
18471847
*/
1848-
pub pure fn as_bytes<T>(s: &const ~str, f: fn((&~[u8])) -> T) -> T {
1848+
pub pure fn as_bytes<T>(s: &const ~str, f: fn(&~[u8]) -> T) -> T {
18491849
unsafe {
18501850
let v: *~[u8] = cast::transmute(copy s);
18511851
f(&*v)

branches/dist-snap/src/libcore/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ pub pure fn reversed<T: Copy>(v: &[const T]) -> ~[T] {
10991099
* Return true to continue, false to break.
11001100
*/
11011101
#[inline(always)]
1102-
pub pure fn each<T>(v: &r/[T], f: fn((&r/T)) -> bool) {
1102+
pub pure fn each<T>(v: &r/[T], f: fn(&r/T) -> bool) {
11031103
// ^^^^
11041104
// NB---this CANNOT be &[const T]! The reason
11051105
// is that you are passing it to `f()` using

branches/dist-snap/src/libstd/fun_treemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub fn find<K: Eq Ord, V: Copy>(m: Treemap<K, V>, k: K) -> Option<V> {
5353
}
5454

5555
/// Visit all pairs in the map in order.
56-
pub fn traverse<K, V: Copy>(m: Treemap<K, V>, f: fn((&K), (&V))) {
56+
pub fn traverse<K, V: Copy>(m: Treemap<K, V>, f: fn(&K, &V)) {
5757
match *m {
5858
Empty => (),
5959
/*

branches/dist-snap/src/libstd/future.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<A> Future<A> {
5151
get_ref(self)
5252
}
5353

54-
fn with<B>(blk: fn((&A)) -> B) -> B {
54+
fn with<B>(blk: fn(&A) -> B) -> B {
5555
//! Work with the value without copying it
5656
5757
with(&self, blk)
@@ -164,7 +164,7 @@ pub fn get<A:Copy>(future: &Future<A>) -> A {
164164
*get_ref(future)
165165
}
166166

167-
pub fn with<A,B>(future: &Future<A>, blk: fn((&A)) -> B) -> B {
167+
pub fn with<A,B>(future: &Future<A>, blk: fn(&A) -> B) -> B {
168168
//! Work with the value without copying it
169169
170170
blk(get_ref(future))

branches/dist-snap/src/libstd/list.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn from_vec<T: Copy>(v: &[T]) -> @List<T> {
2929
* * z - The initial value
3030
* * f - The function to apply
3131
*/
32-
pub fn foldl<T: Copy, U>(z: T, ls: @List<U>, f: fn((&T), (&U)) -> T) -> T {
32+
pub fn foldl<T: Copy, U>(z: T, ls: @List<U>, f: fn(&T, &U) -> T) -> T {
3333
let mut accum: T = z;
3434
do iter(ls) |elt| { accum = f(&accum, elt);}
3535
accum
@@ -42,7 +42,7 @@ pub fn foldl<T: Copy, U>(z: T, ls: @List<U>, f: fn((&T), (&U)) -> T) -> T {
4242
* When function `f` returns true then an option containing the element
4343
* is returned. If `f` matches no elements then none is returned.
4444
*/
45-
pub fn find<T: Copy>(ls: @List<T>, f: fn((&T)) -> bool) -> Option<T> {
45+
pub fn find<T: Copy>(ls: @List<T>, f: fn(&T) -> bool) -> Option<T> {
4646
let mut ls = ls;
4747
loop {
4848
ls = match *ls {
@@ -120,7 +120,7 @@ pure fn push<T: Copy>(ll: &mut @list<T>, vv: T) {
120120
*/
121121

122122
/// Iterate over a list
123-
pub fn iter<T>(l: @List<T>, f: fn((&T))) {
123+
pub fn iter<T>(l: @List<T>, f: fn(&T)) {
124124
let mut cur = l;
125125
loop {
126126
cur = match *cur {
@@ -134,7 +134,7 @@ pub fn iter<T>(l: @List<T>, f: fn((&T))) {
134134
}
135135

136136
/// Iterate over a list
137-
pub fn each<T>(l: @List<T>, f: fn((&T)) -> bool) {
137+
pub fn each<T>(l: @List<T>, f: fn(&T) -> bool) {
138138
let mut cur = l;
139139
loop {
140140
cur = match *cur {

0 commit comments

Comments
 (0)