summary refs log tree commit diff
path: root/src/libserialize/json.rs
AgeCommit message (Collapse)AuthorLines
2014-04-01Json doesn't need to depend on IoError to implement Encodable #13230Eunchong Yu-2/+2
2014-03-30Removed deprecated functions `map` and `flat_map` for vectors and slices.Marvin Löbel-1/+1
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-2/+2
Closes #2569
2014-03-27serialize: use ResultSean McArthur-448/+412
All of Decoder and Encoder's methods now return a Result. Encodable.encode() and Decodable.decode() return a Result as well. fixes #12292
2014-03-27Fix fallout of removing default boundsAlex Crichton-1/+1
This is all purely fallout of getting the previous commit to compile.
2014-03-18closes #12967 fix [en|de]coding of HashMap<K,V> where K is a numeric typeJeff Olson-1/+84
serialize: ref #12697 minor adj. to last char check + prettyencode test
2014-03-18remove duplicate methods in implsCorey Richardson-1/+1
2014-03-12Closes #12829. Names changed for consistency, find_path optimized, method ↵zslayton-35/+24
impls refactored to reduce repitition. Fixed formatting, reworked find_path to use fewer Options. Removed stray tab.
2014-03-11Added convenience methods and accompanying tests to the Json class.zslayton-0/+247
Fixed some styling issues with trailing whitespace. - Removed redundant functions. - Renamed `get` to `find` - Renamed `get_path` to `find_path` - Renamed `find` to `search` - Changed as_object and as_list to return Object and List rather than the underlying implementation types of TreeMap<~str,Json> and ~[Json] - Refactored find_path to use a fold() instead of recursion Formatting fixes. Fixed spacing, deleted comment. Added convenience methods and accompanying tests to the Json class. Updated tests to expect less pointer indirection.
2014-03-04Rename all variables that have uppercase characters in their names to use ↵Palmer Cox-6/+6
only lowercase characters
2014-03-04Cleaned up `std::any`Marvin Löbel-0/+1
- Added `TraitObject` representation to `std::raw`. - Added doc to `std::raw`. - Removed `Any::as_void_ptr()` and `Any::as_mut_void_ptr()` methods as they are uneccessary now after the removal of headers on owned boxes. This reduces the number of virtual calls needed. - Made the `..Ext` implementations work directly with the repr of a trait object. - Removed `Any`-related traits from the prelude. - Added bench for `Any`
2014-02-28std: Change assert_eq!() to use {} instead of {:?}Alex Crichton-3/+3
Formatting via reflection has been a little questionable for some time now, and it's a little unfortunate that one of the standard macros will silently use reflection when you weren't expecting it. This adds small bits of code bloat to libraries, as well as not always being necessary. In light of this information, this commit switches assert_eq!() to using {} in the error message instead of {:?}. In updating existing code, there were a few error cases that I encountered: * It's impossible to define Show for [T, ..N]. I think DST will alleviate this because we can define Show for [T]. * A few types here and there just needed a #[deriving(Show)] * Type parameters needed a Show bound, I often moved this to `assert!(a == b)` * `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths. I don't think this is much of a regression though because {:?} on paths looks awful (it's a byte array). Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime significant for smaller binaries.
2014-02-24Move extra::json to libserializeAlex Crichton-0/+2285
This also inverts the dependency between libserialize and libcollections. cc #8784