remove deprecated vec::{is_empty, len} functions

This commit is contained in:
Daniel Micay 2013-06-08 21:38:47 -04:00
parent 470bf0dfb3
commit de367157b5
38 changed files with 100 additions and 104 deletions

View file

@ -40,7 +40,7 @@ fn send(p: &pipe, msg: uint) {
fn recv(p: &pipe) -> uint {
unsafe {
do p.access_cond |state, cond| {
while vec::is_empty(*state) {
while state.is_empty() {
cond.wait();
}
state.pop()

View file

@ -37,7 +37,7 @@ fn send(p: &pipe, msg: uint) {
}
fn recv(p: &pipe) -> uint {
do p.write_cond |state, cond| {
while vec::is_empty(*state) {
while state.is_empty() {
cond.wait();
}
state.pop()

View file

@ -64,7 +64,7 @@ fn select_random(r: u32, genelist: ~[AminoAcids]) -> char {
} else { return bisect(v, mid, hi, target); }
} else { return v[hi].ch; }
}
return bisect(copy genelist, 0, vec::len::<AminoAcids>(genelist) - 1, r);
return bisect(copy genelist, 0, genelist.len() - 1, r);
}
fn make_random_fasta(wr: @io::Writer,

View file

@ -9,10 +9,12 @@
// except according to those terms.
pub fn main() {
use std::vec::from_fn;
debug!(::std::vec::len(from_fn(2, |i| i)));
use std::util::replace;
let mut x = 5;
replace(&mut x, 6);
{
use std::vec::*;
debug!(len(~[2]));
use std::util::*;
let mut y = 6;
swap(&mut x, &mut y);
}
}

View file

@ -20,7 +20,7 @@ pub fn main() {
grow(&mut v);
grow(&mut v);
grow(&mut v);
let len = vec::len::<int>(v);
let len = v.len();
debug!(len);
assert_eq!(len, 3 as uint);
}

View file

@ -47,7 +47,7 @@ trait vec_utils<T> {
}
impl<T> vec_utils<T> for ~[T] {
fn length_(&self) -> uint { vec::len(*self) }
fn length_(&self) -> uint { self.len() }
fn iter_(&self, f: &fn(&T)) { for self.each |x| { f(x); } }
fn map_<U:Copy>(&self, f: &fn(&T) -> U) -> ~[U] {
let mut r = ~[];

View file

@ -20,7 +20,7 @@ pub fn main() {
assert!(str::len(s) == 10u);
assert!(str::char_len(s) == 4u);
assert!(vec::len(str::to_chars(s)) == 4u);
assert!(str::to_chars(s).len() == 4u);
assert!(str::from_chars(str::to_chars(s)) == s);
assert!(str::char_at(s, 0u) == 'e');
assert!(str::char_at(s, 1u) == 'é');