test: Some test fixes
This commit is contained in:
parent
8fa66e8e07
commit
ac60d53c65
8 changed files with 19 additions and 19 deletions
|
|
@ -11,13 +11,13 @@
|
|||
#[link(name="cci_impl_lib", vers="0.0")];
|
||||
|
||||
trait uint_helpers {
|
||||
fn to(self, v: uint, f: &fn(uint));
|
||||
fn to(&self, v: uint, f: &fn(uint));
|
||||
}
|
||||
|
||||
impl uint_helpers for uint {
|
||||
#[inline]
|
||||
fn to(self, v: uint, f: &fn(uint)) {
|
||||
let mut i = self;
|
||||
fn to(&self, v: uint, f: &fn(uint)) {
|
||||
let mut i = *self;
|
||||
while i < v {
|
||||
f(i);
|
||||
i += 1u;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ trait iterable<A> {
|
|||
|
||||
impl<A> iterable<A> for &self/[A] {
|
||||
fn iterate(&self, f: &fn(x: &A) -> bool) {
|
||||
for vec::each(self) |e| {
|
||||
for vec::each(*self) |e| {
|
||||
if !f(e) { break; }
|
||||
}
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ impl<A> iterable<A> for &self/[A] {
|
|||
|
||||
impl<A> iterable<A> for ~[A] {
|
||||
fn iterate(&self, f: &fn(x: &A) -> bool) {
|
||||
for vec::each(self) |e| {
|
||||
for vec::each(*self) |e| {
|
||||
if !f(e) { break; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ struct Foo {
|
|||
}
|
||||
|
||||
trait Stuff {
|
||||
fn printme(self);
|
||||
fn printme(&self);
|
||||
}
|
||||
|
||||
impl Stuff for &self/Foo {
|
||||
fn printme(self) {
|
||||
impl Stuff for Foo {
|
||||
fn printme(&self) {
|
||||
io::println(fmt!("%d", self.x));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@
|
|||
// except according to those terms.
|
||||
|
||||
trait double {
|
||||
fn double(self) -> uint;
|
||||
fn double(@self) -> uint;
|
||||
}
|
||||
|
||||
impl double for uint {
|
||||
fn double(self) -> uint { self * 2u }
|
||||
fn double(@self) -> uint { *self * 2u }
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@
|
|||
// except according to those terms.
|
||||
|
||||
trait double {
|
||||
fn double(self) -> uint;
|
||||
fn double(@self) -> uint;
|
||||
}
|
||||
|
||||
impl double for @@uint {
|
||||
fn double(self) -> uint { **self * 2u }
|
||||
impl double for @uint {
|
||||
fn double(@self) -> uint { **self * 2u }
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@
|
|||
// except according to those terms.
|
||||
|
||||
trait double {
|
||||
fn double(self) -> uint;
|
||||
fn double(@self) -> uint;
|
||||
}
|
||||
|
||||
impl double for uint {
|
||||
fn double(self) -> uint { self * 2u }
|
||||
fn double(@self) -> uint { *self * 2u }
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@
|
|||
// except according to those terms.
|
||||
|
||||
trait double {
|
||||
fn double(self) -> uint;
|
||||
fn double(@self) -> uint;
|
||||
}
|
||||
|
||||
impl double for uint {
|
||||
fn double(self) -> uint { self * 2u }
|
||||
fn double(@self) -> uint { *self * 2u }
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@
|
|||
// except according to those terms.
|
||||
|
||||
trait Foo {
|
||||
fn foo(self);
|
||||
fn foo(@self);
|
||||
}
|
||||
|
||||
impl Foo for int {
|
||||
fn foo(self) {
|
||||
fn foo(@self) {
|
||||
io::println("Hello world!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue