Skip to content

Commit 3b0f9b7

Browse files
committed
---
yaml --- r: 22187 b: refs/heads/snap-stage3 c: f1014c4 h: refs/heads/master i: 22185: 8f93870 22183: 9535539 v: v3
1 parent 9bdfd73 commit 3b0f9b7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: d0333a8e414e510dace81c4d6fc40a0c77c11ea7
4+
refs/heads/snap-stage3: f1014c43fd4e22fa1a8190e642e05dc6891d6eaa
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libcore/iter.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ pure fn build_sized_opt<A,B: Buildable<A>>(
248248
// Functions that combine iteration and building
249249

250250
/// Apply a function to each element of an iterable and return the results
251-
fn map<T,IT: BaseIter<T>,U,BU: Buildable<U>>(v: IT, f: fn(T) -> U) -> BU {
251+
fn map<T,IT: BaseIter<T>,U,BU: Buildable<U>>(v: &IT, f: fn(&T) -> U) -> BU {
252252
do build_sized_opt(v.size_hint()) |push| {
253253
for v.each() |elem| {
254-
push(f(*elem));
254+
push(f(elem));
255255
}
256256
}
257257
}
@@ -275,17 +275,17 @@ pure fn from_fn<T,BT: Buildable<T>>(n_elts: uint, op: InitOp<T>) -> BT {
275275
* Creates an immutable vector of size `n_elts` and initializes the elements
276276
* to the value `t`.
277277
*/
278-
pure fn from_elem<T: Copy,BT: Buildable<T>>(n_elts: uint, t: T) -> BT {
278+
pure fn from_elem<T: Copy,BT: Buildable<T>>(n_elts: uint, +t: T) -> BT {
279279
do build_sized(n_elts) |push| {
280-
let mut i: uint = 0u;
281-
while i < n_elts { push(t); i += 1u; }
280+
let mut i: uint = 0;
281+
while i < n_elts { push(t); i += 1; }
282282
}
283283
}
284284

285285
/// Appending two generic sequences
286286
#[inline(always)]
287287
pure fn append<T: Copy,IT: BaseIter<T>,BT: Buildable<T>>(
288-
lhs: IT, rhs: IT) -> BT {
288+
lhs: &IT, rhs: &IT) -> BT {
289289
let size_opt = lhs.size_hint().chain_ref(
290290
|sz1| rhs.size_hint().map(|sz2| *sz1+*sz2));
291291
do build_sized_opt(size_opt) |push| {
@@ -298,7 +298,7 @@ pure fn append<T: Copy,IT: BaseIter<T>,BT: Buildable<T>>(
298298
/// type of sequence.
299299
#[inline(always)]
300300
pure fn copy_seq<T: Copy,IT: BaseIter<T>,BT: Buildable<T>>(
301-
v: IT) -> BT {
301+
v: &IT) -> BT {
302302
do build_sized_opt(v.size_hint()) |push| {
303303
for v.each |x| { push(*x); }
304304
}

0 commit comments

Comments
 (0)