Made Tm_ a struct instead of a record and added serialization support to Tm and Tm_.
Not entirely clear what the best way to do this is. Right now we persist the entire struct which seems to be both portable and exactly round-trippable.
This commit is contained in:
parent
7bc29c62d0
commit
a18f0d413c
2 changed files with 82 additions and 17 deletions
|
|
@ -10,6 +10,7 @@ use EBWriter = std::ebml::Writer;
|
|||
use io::Writer;
|
||||
use std::serialization::{Serializable, Deserializable, deserialize};
|
||||
use std::prettyprint;
|
||||
use std::time;
|
||||
|
||||
fn test_prettyprint<A: Serializable<prettyprint::Serializer>>(
|
||||
a: &A,
|
||||
|
|
@ -184,4 +185,7 @@ fn main() {
|
|||
let a = &B;
|
||||
test_prettyprint(a, &~"B");
|
||||
test_ebml(a);
|
||||
|
||||
let a = &time::now();
|
||||
test_ebml(a);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue