Skip to content

Commit 6d142c5

Browse files
committed
Removed the rest of the vec::view calls that were marked with #2880. Fixes #2880.
1 parent 65beca4 commit 6d142c5

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

src/libstd/ebml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn tagged_docs(d: doc, tg: uint, it: fn(doc) -> bool) {
127127
fn doc_data(d: doc) -> ~[u8] { vec::slice::<u8>(*d.data, d.start, d.end) }
128128

129129
fn with_doc_data<T>(d: doc, f: fn(x: &[u8]) -> T) -> T {
130-
ret f(vec::slice(*d.data, d.start, d.end));
130+
ret f(vec::view(*d.data, d.start, d.end));
131131
}
132132

133133
fn doc_as_str(d: doc) -> ~str { ret str::from_bytes(doc_data(d)); }

src/rustc/back/rpath.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ fn get_relative_to(abs1: path::path, abs2: path::path) -> path::path {
145145
let mut path = ~[];
146146
for uint::range(start_idx, len1 - 1u) |_i| { vec::push(path, ~".."); };
147147

148-
// FIXME (#2880): use view here.
149-
vec::push_all(path, vec::slice(split2, start_idx, len2 - 1u));
148+
vec::push_all(path, vec::view(split2, start_idx, len2 - 1u));
150149

151150
if vec::is_not_empty(path) {
152151
ret path::connect_many(path);

src/rustc/middle/trans/alt.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ fn expand_nested_bindings(m: match, col: uint, val: ValueRef) -> match {
113113
let pats = vec::append(
114114
vec::slice(br.pats, 0u, col),
115115
vec::append(~[inner],
116-
// FIXME (#2880): use view here.
117-
vec::slice(br.pats, col + 1u, br.pats.len())));
116+
vec::view(br.pats, col + 1u, br.pats.len())));
118117
vec::push(result,
119118
@{pats: pats,
120119
bound: vec::append(
@@ -137,10 +136,8 @@ fn enter_match(dm: DefMap, m: match, col: uint, val: ValueRef,
137136
alt e(br.pats[col]) {
138137
some(sub) {
139138
let pats = vec::append(
140-
// FIXME (#2880): use view here.
141-
vec::append(sub, vec::slice(br.pats, 0u, col)),
142-
// FIXME (#2880): use view here.
143-
vec::slice(br.pats, col + 1u, br.pats.len()));
139+
vec::append(sub, vec::view(br.pats, 0u, col)),
140+
vec::view(br.pats, col + 1u, br.pats.len()));
144141
let self = br.pats[col];
145142
let bound = alt self.node {
146143
ast::pat_ident(name, none) if !pat_is_variant(dm, self) {
@@ -429,8 +426,7 @@ fn compile_submatch(bcx: block, m: match, vals: ~[ValueRef],
429426
} else { m };
430427

431428
let vals_left = vec::append(vec::slice(vals, 0u, col),
432-
// FIXME (#2880): use view here.
433-
vec::slice(vals, col + 1u, vals.len()));
429+
vec::view(vals, col + 1u, vals.len()));
434430
let ccx = bcx.fcx.ccx;
435431
let mut pat_id = 0;
436432
for vec::each(m) |br| {

src/rustc/middle/trans/common.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,7 @@ fn revoke_clean(cx: block, val: ValueRef) {
314314
})) |i| {
315315
info.cleanups =
316316
vec::append(vec::slice(info.cleanups, 0u, i),
317-
// FIXME (#2880): use view here.
318-
vec::slice(info.cleanups,
317+
vec::view(info.cleanups,
319318
i + 1u,
320319
info.cleanups.len()));
321320
scope_clean_changed(info);

0 commit comments

Comments
 (0)