diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-05-16 08:55:57 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-05-16 08:55:57 +1000 |
| commit | 5dc5efefd47527067ab5b7862d89a99da4824f49 (patch) | |
| tree | cc012135abd498773efbdb299163035af2e7d989 /src/libstd | |
| parent | 6a9c3bd86e0271f26dc63bd12e0d54a35b704dff (diff) | |
| download | rust-5dc5efefd47527067ab5b7862d89a99da4824f49.tar.gz rust-5dc5efefd47527067ab5b7862d89a99da4824f49.zip | |
syntax: deprecate #[auto_{en,de}code] in favour of #[deriving({En,De}codable)].
Replace all instances of #[auto_*code] with the appropriate #[deriving] attribute and remove the majority of the actual code, leaving stubs to refer the user to the new syntax.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/json.rs | 12 | ||||
| -rw-r--r-- | src/libstd/time.rs | 8 | ||||
| -rw-r--r-- | src/libstd/workcache.rs | 4 |
3 files changed, 6 insertions, 18 deletions
diff --git a/src/libstd/json.rs b/src/libstd/json.rs index 7702b46ddcb..270cf675c87 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -1331,26 +1331,20 @@ mod tests { use std::serialize::Decodable; - #[auto_encode] - #[auto_decode] - #[deriving(Eq)] + #[deriving(Eq, Encodable, Decodable)] enum Animal { Dog, Frog(~str, int) } - #[auto_encode] - #[auto_decode] - #[deriving(Eq)] + #[deriving(Eq, Encodable, Decodable)] struct Inner { a: (), b: uint, c: ~[~str], } - #[auto_encode] - #[auto_decode] - #[deriving(Eq)] + #[deriving(Eq, Encodable, Decodable)] struct Outer { inner: ~[Inner], } diff --git a/src/libstd/time.rs b/src/libstd/time.rs index e731f679221..202b96f9797 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -29,9 +29,7 @@ pub mod rustrt { } /// A record specifying a time value in seconds and nanoseconds. -#[auto_encode] -#[auto_decode] -#[deriving(Eq)] +#[deriving(Eq, Encodable, Decodable)] pub struct Timespec { sec: i64, nsec: i32 } /* @@ -100,9 +98,7 @@ pub fn tzset() { } } -#[auto_encode] -#[auto_decode] -#[deriving(Eq)] +#[deriving(Eq, Encodable, Decodable)] pub struct Tm { tm_sec: i32, // seconds after the minute ~[0-60] tm_min: i32, // minutes after the hour ~[0-59] diff --git a/src/libstd/workcache.rs b/src/libstd/workcache.rs index a9e4ec50c7c..f173df60df8 100644 --- a/src/libstd/workcache.rs +++ b/src/libstd/workcache.rs @@ -92,9 +92,7 @@ use core::util::replace; * */ -#[deriving(Eq)] -#[auto_encode] -#[auto_decode] +#[deriving(Eq, Encodable, Decodable)] struct WorkKey { kind: ~str, name: ~str |
