Commit Graph

84 Commits

Author SHA1 Message Date
Erick Tryzelaar 5378d22708 Switch to the new custom_deserialize syntax 2015-03-19 20:19:49 -07:00
Erick Tryzelaar 8821421357 Docs, json::Value::U64, and bring many of the rust-serialize fns to Value 2015-03-18 20:51:48 -07:00
Erick Tryzelaar eb4af09456 Simplify the variant deserializer visitor 2015-03-18 07:35:05 -07:00
Erick Tryzelaar 78137ee3a4 Rewrite enum deserialization to not require allocations 2015-03-16 22:42:04 -07:00
Erick Tryzelaar b40d8f7bac Remove the first argument from visit_{seq,map}_elt 2015-03-16 22:30:02 -07:00
Oliver Schneider f21cbb71e2 MapVisitor::end and SeqVisitor::end were mostly never called 2015-03-16 13:27:00 +01:00
Erick Tryzelaar 87ff636c10 Fix some warnings 2015-03-14 12:03:53 -07:00
Erick Tryzelaar aedd5f57cf Split json compact and pretty serializer. Recover 20MB/s 2015-03-12 21:15:47 -07:00
Erick Tryzelaar dc87288f48 Allow json missing fields to be treated as a null
Closes #34.
2015-03-12 20:44:16 -07:00
Erick Tryzelaar 5dd53e7ea3 Change ser::{Seq,Map}Visitor to return an optional exact length
This is necessary for formats that serialize the length in the
format stream. Those formats need the exact length, so the
iterator-style size_hint has the wrong semantics.
2015-03-12 19:40:46 -07:00
Erick Tryzelaar 9e454a243a Rename Serialize::visit to Serialize::serialize 2015-03-12 07:33:34 -07:00
Erick Tryzelaar 3f62b6d2bf Merge ser::Serializer and ser::Visitor 2015-03-11 11:05:46 -07:00
Erick Tryzelaar fbd6d1974a Remove the unused Serializer::Value associated type 2015-03-11 10:15:27 -07:00
Erick Tryzelaar 805a3435cf Replace serde1 with serde2!
Closes #26!
2015-03-08 22:56:33 -07:00
Erick Tryzelaar 65cfcd03f8 Port serde2 to std::io, which cuts the speed by 26% :( 2015-02-16 18:17:50 -08:00
Erick Tryzelaar 1f98ee0d8f Use writer.write_all(b"...") instead of write! for static strings 2015-02-14 10:19:15 -08:00
Erick Tryzelaar 004a89510e ported over to the new std::io, but it's half the speed of std::old_io 2015-02-14 10:01:22 -08:00
Erick Tryzelaar 4dccf8cdec Clean up warnings in serde 2015-02-13 10:26:13 -08:00
Thomas Bahn 70e8556e07 Follow rustc: New destructor semantics 2015-02-06 22:27:19 +01:00
Thomas Bahn 03820f3d78 Switch to rustc_serialize for tests 2015-02-06 22:27:19 +01:00
Thomas Bahn a87fab9ecc Simplify some code using auto-deref 2015-02-06 22:23:16 +01:00
Thomas Bahn 81f84a4ea4 Remove unneeded mut specifiers 2015-02-06 22:23:16 +01:00
Thomas Bahn 79ff9fdafa Use the IntoIterator trait in for loops 2015-02-06 22:23:16 +01:00
Thomas Bahn cb8492d74b Follow rust std: Error requires an implementation of fmt::Display 2015-02-06 22:23:16 +01:00
Thomas Bahn 5782657502 Follow rust std: The old io module is now called old_io 2015-02-06 22:23:16 +01:00
Thomas Bahn 9a284ae7c2 Follow rust std: fmt::Show was renamed to fmt::Debug 2015-02-06 22:23:16 +01:00
Thomas Bahn 5dd077969c Use slicing syntax instead of .as_slice() 2015-02-06 22:23:16 +01:00
Thomas Bahn 3022d7301a Use deref coercions when possible 2015-02-06 22:23:15 +01:00
Thomas Bahn 361acd37d0 Follow rust std: int, uint were renamed to isize, usize 2015-02-06 22:23:15 +01:00
Dan Burkert 460dbce8cc Update for rustc 1.0.0-nightly (8903c21d6 2015-01-15 22:42:58 +0000) 2015-01-17 16:36:15 -08:00
Erick Tryzelaar 8715a41158 Update to rust HEAD 2015-01-07 09:30:11 -08:00
Erick Tryzelaar b98719a4a0 update to rust HEAD, switch to rustc_serialize 2015-01-04 17:18:50 -08:00
Thomas Bahn 814c0570b8 Fix: String::from_utf8 became stable and changed signature 2015-01-01 14:22:23 +01:00
Thomas Bahn 85d0c8e4e8 Rename FP* to FpCategory::* following std changes 2014-12-30 14:52:27 +01:00
Thomas Bahn 91cfb003d9 Fix: String::from_utf8 changed function signature
Following a rust std change.
2014-12-23 18:05:58 +01:00
Thomas Bahn 3cf0fb8d5b Fix: Utf16 handling moved from std into unicode crate
Following a rust change.
2014-12-23 18:05:58 +01:00
Thomas Bahn 0957d5769d Replace StrAllocating with String type in function parameters
The key parameter of the insert functions are of type String now.
As insert requires ownership of its parameter `key` and StrAllocating
being gone in rust these functions now communicate that ownership
in their signature.

As a result &str must be converted into a String at the caller instead
of the callee.

The Trait ToOwned isn't an alternative as it's a generalized Clone.
StrAllocating simply has hidden an allocation or move.
2014-12-23 18:05:58 +01:00
Thomas Bahn cca63836d2 Replace MoveItems and MoveEntries with IntoIter
Following a rust std change.
2014-12-23 18:05:58 +01:00
Thomas Bahn 681a609844 Replace TreeMap with BTreeMap in the serde tests 2014-12-23 17:44:26 +01:00
Thomas Bahn 19bda6a90d Replace TreeMap/TreeSet with BTreeMap/BTreeSet in serde
Follow rust std changes:
https://github.com/rust-lang/rfcs/blob/master/text/0509-collections-reform-part-2.md
2014-12-20 14:42:48 +01:00
Thomas Bahn d6807c0e90 Append semicolon to item macro invocations in serde
Following changes in rustc.
2014-12-19 08:59:11 +01:00
Erick Tryzelaar 246396fdb4 update to rust HEAD, fix the tests 2014-12-13 16:55:42 -08:00
Erick Tryzelaar e5ddf759de cleanup serde::json::value 2014-12-05 22:33:30 -08:00
Erick Tryzelaar 0bd94c7653 serde List -> Array 2014-12-05 22:23:03 -08:00
Erick Tryzelaar 38dc9aaf72 clean up serde json deserializing 2014-12-05 22:19:05 -08:00
Erick Tryzelaar 9d55333f06 update to the latest nightly 2014-12-01 12:21:18 -08:00
Erick Tryzelaar 857723dff6 Fix serde to compile on master again 2014-11-22 16:27:01 -08:00
Erick Tryzelaar ff8c8c77cc Update to latest rust master 2014-11-17 19:21:46 -08:00
Erick Tryzelaar 18d943e8a7 migrate json deserializer into it's own module, clean up errors 2014-11-14 20:55:49 -08:00
Erick Tryzelaar 4ce5ae8025 pull the json serializer into it's own module 2014-11-14 20:55:49 -08:00