about summary refs log tree commit diff
path: root/src/libstd/serialize.rs
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-12-18 18:05:16 -0800
committerBrian Anderson <banderson@mozilla.com>2012-12-18 18:35:18 -0800
commit97ddf3c7bdbd874ad6596e9444abb61b5903bc04 (patch)
treed6ef056a83801ddf331cec3e482f3639a40a89ae /src/libstd/serialize.rs
parent8e28f23c60daae7042e2c279741fa90f623acac0 (diff)
downloadrust-97ddf3c7bdbd874ad6596e9444abb61b5903bc04.tar.gz
rust-97ddf3c7bdbd874ad6596e9444abb61b5903bc04.zip
Stop resolving static methods at the module level. Closes #4179
Diffstat (limited to 'src/libstd/serialize.rs')
-rw-r--r--src/libstd/serialize.rs39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/libstd/serialize.rs b/src/libstd/serialize.rs
index a2c80914fd6..e32dda04579 100644
--- a/src/libstd/serialize.rs
+++ b/src/libstd/serialize.rs
@@ -298,7 +298,7 @@ pub impl<S: Encoder, T: Encodable<S>> ~T: Encodable<S> {
 
 pub impl<D: Decoder, T: Decodable<D>> ~T: Decodable<D> {
     static fn decode(&self, d: &D) -> ~T {
-        d.read_owned(|| ~decode(d))
+        d.read_owned(|| ~Decodable::decode(d))
     }
 }
 
@@ -310,7 +310,7 @@ pub impl<S: Encoder, T: Encodable<S>> @T: Encodable<S> {
 
 pub impl<D: Decoder, T: Decodable<D>> @T: Decodable<D> {
     static fn decode(&self, d: &D) -> @T {
-        d.read_managed(|| @decode(d))
+        d.read_managed(|| @Decodable::decode(d))
     }
 }
 
@@ -338,7 +338,7 @@ pub impl<D: Decoder, T: Decodable<D>> ~[T]: Decodable<D> {
     static fn decode(&self, d: &D) -> ~[T] {
         do d.read_owned_vec |len| {
             do vec::from_fn(len) |i| {
-                d.read_vec_elt(i, || decode(d))
+                d.read_vec_elt(i, || Decodable::decode(d))
             }
         }
     }
@@ -358,7 +358,7 @@ pub impl<D: Decoder, T: Decodable<D>> @[T]: Decodable<D> {
     static fn decode(&self, d: &D) -> @[T] {
         do d.read_managed_vec |len| {
             do at_vec::from_fn(len) |i| {
-                d.read_vec_elt(i, || decode(d))
+                d.read_vec_elt(i, || Decodable::decode(d))
             }
         }
     }
@@ -385,7 +385,8 @@ pub impl<D: Decoder, T: Decodable<D>> Option<T>: Decodable<D> {
             do d.read_enum_variant |i| {
                 match i {
                   0 => None,
-                  1 => Some(d.read_enum_variant_arg(0u, || decode(d))),
+                  1 => Some(d.read_enum_variant_arg(
+                      0u, || Decodable::decode(d))),
                   _ => fail(fmt!("Bad variant for option: %u", i))
                 }
             }
@@ -418,8 +419,8 @@ pub impl<
     static fn decode(&self, d: &D) -> (T0, T1) {
         do d.read_tup(2) {
             (
-                d.read_tup_elt(0, || decode(d)),
-                d.read_tup_elt(1, || decode(d))
+                d.read_tup_elt(0, || Decodable::decode(d)),
+                d.read_tup_elt(1, || Decodable::decode(d))
             )
         }
     }
@@ -453,9 +454,9 @@ pub impl<
     static fn decode(&self, d: &D) -> (T0, T1, T2) {
         do d.read_tup(3) {
             (
-                d.read_tup_elt(0, || decode(d)),
-                d.read_tup_elt(1, || decode(d)),
-                d.read_tup_elt(2, || decode(d))
+                d.read_tup_elt(0, || Decodable::decode(d)),
+                d.read_tup_elt(1, || Decodable::decode(d)),
+                d.read_tup_elt(2, || Decodable::decode(d))
             )
         }
     }
@@ -492,10 +493,10 @@ pub impl<
     static fn decode(&self, d: &D) -> (T0, T1, T2, T3) {
         do d.read_tup(4) {
             (
-                d.read_tup_elt(0, || decode(d)),
-                d.read_tup_elt(1, || decode(d)),
-                d.read_tup_elt(2, || decode(d)),
-                d.read_tup_elt(3, || decode(d))
+                d.read_tup_elt(0, || Decodable::decode(d)),
+                d.read_tup_elt(1, || Decodable::decode(d)),
+                d.read_tup_elt(2, || Decodable::decode(d)),
+                d.read_tup_elt(3, || Decodable::decode(d))
             )
         }
     }
@@ -536,11 +537,11 @@ pub impl<
       -> (T0, T1, T2, T3, T4) {
         do d.read_tup(5) {
             (
-                d.read_tup_elt(0, || decode(d)),
-                d.read_tup_elt(1, || decode(d)),
-                d.read_tup_elt(2, || decode(d)),
-                d.read_tup_elt(3, || decode(d)),
-                d.read_tup_elt(4, || decode(d))
+                d.read_tup_elt(0, || Decodable::decode(d)),
+                d.read_tup_elt(1, || Decodable::decode(d)),
+                d.read_tup_elt(2, || Decodable::decode(d)),
+                d.read_tup_elt(3, || Decodable::decode(d)),
+                d.read_tup_elt(4, || Decodable::decode(d))
             )
         }
     }