Skip to content

Commit

Permalink
Removed the rest of the vec::view calls that were marked with #2880. F…
Browse files Browse the repository at this point in the history
…ixes #2880.
  • Loading branch information
eholk committed Jul 27, 2012
1 parent 65beca4 commit 6d142c5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/libstd/ebml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn tagged_docs(d: doc, tg: uint, it: fn(doc) -> bool) {
fn doc_data(d: doc) -> ~[u8] { vec::slice::<u8>(*d.data, d.start, d.end) }

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

fn doc_as_str(d: doc) -> ~str { ret str::from_bytes(doc_data(d)); }
Expand Down
3 changes: 1 addition & 2 deletions src/rustc/back/rpath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ fn get_relative_to(abs1: path::path, abs2: path::path) -> path::path {
let mut path = ~[];
for uint::range(start_idx, len1 - 1u) |_i| { vec::push(path, ~".."); };

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

if vec::is_not_empty(path) {
ret path::connect_many(path);
Expand Down
12 changes: 4 additions & 8 deletions src/rustc/middle/trans/alt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ fn expand_nested_bindings(m: match, col: uint, val: ValueRef) -> match {
let pats = vec::append(
vec::slice(br.pats, 0u, col),
vec::append(~[inner],
// FIXME (#2880): use view here.
vec::slice(br.pats, col + 1u, br.pats.len())));
vec::view(br.pats, col + 1u, br.pats.len())));
vec::push(result,
@{pats: pats,
bound: vec::append(
Expand All @@ -137,10 +136,8 @@ fn enter_match(dm: DefMap, m: match, col: uint, val: ValueRef,
alt e(br.pats[col]) {
some(sub) {
let pats = vec::append(
// FIXME (#2880): use view here.
vec::append(sub, vec::slice(br.pats, 0u, col)),
// FIXME (#2880): use view here.
vec::slice(br.pats, col + 1u, br.pats.len()));
vec::append(sub, vec::view(br.pats, 0u, col)),
vec::view(br.pats, col + 1u, br.pats.len()));
let self = br.pats[col];
let bound = alt self.node {
ast::pat_ident(name, none) if !pat_is_variant(dm, self) {
Expand Down Expand Up @@ -429,8 +426,7 @@ fn compile_submatch(bcx: block, m: match, vals: ~[ValueRef],
} else { m };

let vals_left = vec::append(vec::slice(vals, 0u, col),
// FIXME (#2880): use view here.
vec::slice(vals, col + 1u, vals.len()));
vec::view(vals, col + 1u, vals.len()));
let ccx = bcx.fcx.ccx;
let mut pat_id = 0;
for vec::each(m) |br| {
Expand Down
3 changes: 1 addition & 2 deletions src/rustc/middle/trans/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,7 @@ fn revoke_clean(cx: block, val: ValueRef) {
})) |i| {
info.cleanups =
vec::append(vec::slice(info.cleanups, 0u, i),
// FIXME (#2880): use view here.
vec::slice(info.cleanups,
vec::view(info.cleanups,
i + 1u,
info.cleanups.len()));
scope_clean_changed(info);
Expand Down

0 comments on commit 6d142c5

Please sign in to comment.