Change some uses of static methods to use the trait path
This commit is contained in:
parent
732c39c183
commit
e7ef82dd70
@ -36,7 +36,7 @@
|
||||
pub use f64::signbit;
|
||||
pub use f64::{j0, j1, jn, y0, y1, yn};
|
||||
use cmp::{Eq, Ord};
|
||||
use num::from_int;
|
||||
use num::Num::from_int;
|
||||
|
||||
pub const NaN: float = 0.0/0.0;
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
use cmp::{Eq, Ord};
|
||||
use from_str::FromStr;
|
||||
use num::from_int;
|
||||
use num::Num::from_int;
|
||||
|
||||
pub const bits : uint = inst::bits;
|
||||
pub const bytes : uint = (inst::bits / 8);
|
||||
|
@ -244,7 +244,7 @@ pub trait Buildable<A> {
|
||||
#[inline(always)]
|
||||
pub pure fn build<A,B: Buildable<A>>(builder: fn(push: pure fn(v: A)))
|
||||
-> B {
|
||||
build_sized(4, builder)
|
||||
Buildable::build_sized(4, builder)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -265,7 +265,7 @@ pub trait Buildable<A> {
|
||||
size: Option<uint>,
|
||||
builder: fn(push: pure fn(v: A))) -> B {
|
||||
|
||||
build_sized(size.get_default(4), builder)
|
||||
Buildable::build_sized(size.get_default(4), builder)
|
||||
}
|
||||
|
||||
// Functions that combine iteration and building
|
||||
@ -288,7 +288,7 @@ pub fn map<T,IT: BaseIter<T>,U,BU: Buildable<U>>(v: &IT, f: fn(&T) -> U)
|
||||
*/
|
||||
pub pure fn from_fn<T,BT: Buildable<T>>(n_elts: uint,
|
||||
op: InitOp<T>) -> BT {
|
||||
do build_sized(n_elts) |push| {
|
||||
do Buildable::build_sized(n_elts) |push| {
|
||||
let mut i: uint = 0u;
|
||||
while i < n_elts { push(op(i)); i += 1u; }
|
||||
}
|
||||
@ -302,7 +302,7 @@ pub fn map<T,IT: BaseIter<T>,U,BU: Buildable<U>>(v: &IT, f: fn(&T) -> U)
|
||||
*/
|
||||
pub pure fn from_elem<T: Copy,BT: Buildable<T>>(n_elts: uint,
|
||||
t: T) -> BT {
|
||||
do build_sized(n_elts) |push| {
|
||||
do Buildable::build_sized(n_elts) |push| {
|
||||
let mut i: uint = 0;
|
||||
while i < n_elts { push(t); i += 1; }
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ pub struct WindowsPath {
|
||||
}
|
||||
|
||||
pub pure fn WindowsPath(s: &str) -> WindowsPath {
|
||||
from_str(s)
|
||||
GenericPath::from_str(s)
|
||||
}
|
||||
|
||||
#[deriving_eq]
|
||||
@ -39,7 +39,7 @@ pub struct PosixPath {
|
||||
}
|
||||
|
||||
pub pure fn PosixPath(s: &str) -> PosixPath {
|
||||
from_str(s)
|
||||
GenericPath::from_str(s)
|
||||
}
|
||||
|
||||
pub trait GenericPath {
|
||||
|
@ -16,8 +16,7 @@
|
||||
use json;
|
||||
use sha1;
|
||||
use serialization::{Serializer,Serializable,
|
||||
Deserializer,Deserializable,
|
||||
deserialize};
|
||||
Deserializer,Deserializable};
|
||||
|
||||
/**
|
||||
*
|
||||
@ -261,7 +260,7 @@ fn exec<T:Owned
|
||||
|
||||
let v : T = do io::with_str_reader(res) |rdr| {
|
||||
let j = result::unwrap(json::from_reader(rdr));
|
||||
deserialize(&json::Deserializer(move j))
|
||||
Deserializable::deserialize(&json::Deserializer(move j))
|
||||
};
|
||||
return Work::new(self, move Left(move v));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user