1
- // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1
+ // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
2
2
// file at the top-level directory of this distribution and at
3
3
// http://rust-lang.org/COPYRIGHT.
4
4
//
@@ -69,7 +69,7 @@ pub trait CopyableNonstrictIter<A:Copy> {
69
69
pure fn each_val ( & const self , f : & fn ( A ) -> bool ) ;
70
70
}
71
71
72
- // A trait for sequences that can be by imperatively pushing elements
72
+ // A trait for sequences that can be built by imperatively pushing elements
73
73
// onto them.
74
74
pub trait Buildable < A > {
75
75
/**
@@ -198,7 +198,7 @@ pub pure fn position<A,IA:BaseIter<A>>(self: &IA, f: fn(&A) -> bool)
198
198
}
199
199
200
200
// note: 'rposition' would only make sense to provide with a bidirectional
201
- // iter interface, such as would provide "reach" in addition to "each". as is,
201
+ // iter interface, such as would provide "reach" in addition to "each". As is,
202
202
// it would have to be implemented with foldr, which is too inefficient.
203
203
204
204
#[ inline( always) ]
@@ -269,13 +269,13 @@ pub pure fn build<A,B: Buildable<A>>(builder: fn(push: pure fn(A)))
269
269
270
270
/**
271
271
* Builds a sequence by calling a provided function with an argument
272
- * function that pushes an element to the back of a sequence.
272
+ * function that pushes an element to the back of the sequence.
273
273
* This version takes an initial size for the sequence.
274
274
*
275
275
* # Arguments
276
276
*
277
277
* * size - An option, maybe containing initial size of the sequence
278
- * to reserve
278
+ * to reserve.
279
279
* * builder - A function that will construct the sequence. It receives
280
280
* as an argument a function that will push an element
281
281
* onto the sequence being constructed.
@@ -290,7 +290,7 @@ pub pure fn build_sized_opt<A,B: Buildable<A>>(
290
290
291
291
// Functions that combine iteration and building
292
292
293
- /// Apply a function to each element of an iterable and return the results
293
+ /// Applies a function to each element of an iterable and returns the results.
294
294
#[ inline( always) ]
295
295
pub fn map < T , IT : BaseIter < T > , U , BU : Buildable < U > > ( v : & IT , f : fn ( & T ) -> U )
296
296
-> BU {
@@ -302,7 +302,7 @@ pub fn map<T,IT: BaseIter<T>,U,BU: Buildable<U>>(v: &IT, f: fn(&T) -> U)
302
302
}
303
303
304
304
/**
305
- * Creates and initializes a generic sequence from a function
305
+ * Creates and initializes a generic sequence from a function.
306
306
*
307
307
* Creates a generic sequence of size `n_elts` and initializes the elements
308
308
* to the value returned by the function `op`.
@@ -317,7 +317,7 @@ pub pure fn from_fn<T,BT: Buildable<T>>(n_elts: uint,
317
317
}
318
318
319
319
/**
320
- * Creates and initializes a generic sequence with some element
320
+ * Creates and initializes a generic sequence with some elements.
321
321
*
322
322
* Creates an immutable vector of size `n_elts` and initializes the elements
323
323
* to the value `t`.
@@ -331,7 +331,7 @@ pub pure fn from_elem<T:Copy,BT:Buildable<T>>(n_elts: uint,
331
331
}
332
332
}
333
333
334
- /// Appending two generic sequences
334
+ /// Appends two generic sequences.
335
335
#[ inline( always) ]
336
336
pub pure fn append < T : Copy , IT : BaseIter < T > , BT : Buildable < T > > (
337
337
lhs : & IT , rhs : & IT ) -> BT {
0 commit comments