about summary refs log tree commit diff
path: root/src/libserialize/json.rs
AgeCommit message (Collapse)AuthorLines
2014-06-03Implement ToJson for &[T], and add tests. Closes #14619Jorge Aparicio-0/+54
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-12/+12
This is part of the ongoing renaming of the equality traits. See #12517 for more details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord} or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}. cc #12517 [breaking-change]
2014-05-28std: Remove format_strbuf!()Alex Crichton-7/+7
This was only ever a transitionary macro.
2014-05-27Move std::{reflect,repr,Poly} to a libdebug crateAlex Crichton-5/+5
This commit moves reflection (as well as the {:?} format modifier) to a new libdebug crate, all of which is marked experimental. This is a breaking change because it now requires the debug crate to be explicitly linked if the :? format qualifier is used. This means that any code using this feature will have to add `extern crate debug;` to the top of the crate. Any code relying on reflection will also need to do this. Closes #12019 [breaking-change]
2014-05-27auto merge of #14414 : richo/rust/features/nerf_unused_string_fns, ↵bors-135/+135
r=alexcrichton This should block on #14323
2014-05-27std: Rename strbuf operations to stringRicho Healey-135/+135
[breaking-change]
2014-05-27serialize: Remove old commented out codeErick Tryzelaar-30/+0
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-48/+48
[breaking-change]
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-1/+1
[breaking-change]
2014-05-22libstd: Remove all uses of `~str` from `libstd`Patrick Walton-3/+9
2014-05-16libserialize: Remove all uses of `~str` from `libserialize`.Patrick Walton-204/+232
Had to make `struct Tm` in `libtime` not serializable for now.
2014-05-15Updates with core::fmt changesAlex Crichton-1/+1
1. Wherever the `buf` field of a `Formatter` was used, the `Formatter` is used instead. 2. The usage of `write_fmt` is minimized as much as possible, the `write!` macro is preferred wherever possible. 3. Usage of `fmt::write` is minimized, favoring the `write!` macro instead.
2014-05-13serialize: Broaden ignores of json testsAlex Crichton-2/+2
It was thought that these failures only happened on windows, turns out they happen on any 32-bit machine. cc #14064
2014-05-09auto merge of #14065 : alexcrichton/rust/ignore-flaky-windows-test, r=brsonbors-0/+2
See #14064 for some rationale, but the basic idea is that I suspect that there is an LLVM codegen bug somewhere, and I'm not entirely sure why it's happening intermittently rather than deterministically... cc #14064
2014-05-09serialize: Ignore two flaky json tests on windowsAlex Crichton-0/+2
See #14064 for some rationale, but the basic idea is that I suspect that there is an LLVM codegen bug somewhere, and I'm not entirely sure why it's happening intermittently rather than deterministically... cc #14064
2014-05-08Handle fallout in documentationKevin Ballard-4/+4
Tweak the tutorial's section on vectors and strings, to slightly clarify the difference between fixed-size vectors, vectors, and slices.
2014-05-08Handle fallout in libserializeKevin Ballard-38/+38
API Changes: - from_base64() returns Result<Vec<u8>, FromBase64Error> - from_hex() returns Result<Vec<u8>, FromHexError> - json::List is a Vec<Json> - Decodable is no longer implemented on ~[T] (but Encodable still is) - DecoderHelpers::read_to_vec() returns a Result<Vec<T>, E>
2014-05-07core: Inherit non-allocating slice functionalityAlex Crichton-1/+0
This commit adds a new trait, MutableVectorAllocating, which represents functions on vectors which can allocate. This is another extension trait to slices which should be removed once a lang item exists for the ~ allocation.
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-8/+7
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-03auto merge of #13773 : brson/rust/boxxy, r=alexcrichtonbors-63/+63
`box` is the way you allocate in future-rust.
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-63/+63
2014-05-02Implement ToJson for Vec<T>Herman J. Radtke III-0/+4
Now that ~[T] is obsolete, we need to allow to_json() to work for vectors.
2014-05-01auto merge of #13886 : japaric/rust/fix-an-typos, r=alexcrichtonbors-2/+2
Found the first one in the rust reference docs. I was going to submit a PR with one fix, but figured I could look for more... This is the result.
2014-05-01Fix a/an typosJorge Aparicio-2/+2
2014-05-01auto merge of #13877 : thestinger/rust/de-tilde-str-vec, r=alexcrichtonbors-20/+20
2014-05-01remove leftover obsolete string literalsDaniel Micay-19/+19
2014-04-30Add serialization support for StrBufHerman J. Radtke III-35/+23
- implement Encodable and Decodable for StrBuf - implement to_json for StrBuf
2014-04-30librustc: Remove `~"string"` and `&"string"` from the languagePatrick Walton-1/+1
2014-04-30auto merge of #13648 : gereeter/rust/removed-rev, r=alexcrichtonbors-2/+2
In the process, `Splits` got changed to be more like `CharSplits` in `str` to present the DEI interface. Note that `treemap` still has a `rev_iter` function because it seems like it would be a significant interface change to expose a DEI - the iterator would have to gain an extra pointer, the completion checks would be more complicated, and it isn't easy to check that such an implementation is correct due to the use of unsafety to subvert the aliasing properties of `&mut`. This fixes #9391.
2014-04-28Deprecate the rev_iter pattern in all places where a DoubleEndedIterator is ↵Jonathan S-2/+2
provided (everywhere but treemap) This commit deprecates rev_iter, mut_rev_iter, move_rev_iter everywhere (except treemap) and also deprecates related functions like rsplit, rev_components, and rev_str_components. In every case, these functions can be replaced with the non-reversed form followed by a call to .rev(). To make this more concrete, a translation table for all functional changes necessary follows: * container.rev_iter() -> container.iter().rev() * container.mut_rev_iter() -> container.mut_iter().rev() * container.move_rev_iter() -> container.move_iter().rev() * sliceorstr.rsplit(sep) -> sliceorstr.split(sep).rev() * path.rev_components() -> path.components().rev() * path.rev_str_components() -> path.str_components().rev() In terms of the type system, this change also deprecates any specialized reversed iterator types (except in treemap), opting instead to use Rev directly if any type annotations are needed. However, since methods directly returning reversed iterators are now discouraged, the need for such annotations should be small. However, in those cases, the general pattern for conversion is to take whatever follows Rev in the original reversed name and surround it with Rev<>: * RevComponents<'a> -> Rev<Components<'a>> * RevStrComponents<'a> -> Rev<StrComponents<'a>> * RevItems<'a, T> -> Rev<Items<'a, T>> * etc. The reasoning behind this change is that it makes the standard API much simpler without reducing readability, performance, or power. The presence of functions such as rev_iter adds more boilerplate code to libraries (all of which simply call .iter().rev()), clutters up the documentation, and only helps code by saving two characters. Additionally, the numerous type synonyms that were used to make the type signatures look nice like RevItems add even more boilerplate and clutter up the docs even more. With this change, all that cruft goes away. [breaking-change]
2014-04-27Fix a code formatting issue in json.rsNicolas Silva-1/+2
2014-04-27Add a streaming parser to serialize::json.Nicolas Silva-261/+1048
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-193/+196
2014-04-18Update the rest of the compiler with ~[T] changesAlex Crichton-5/+5
2014-04-11Decode non-BMP hex escapes in JSONKeegan McAllister-25/+65
Fixes #13064.
2014-04-10libstd: Implement `StrBuf`, a new string buffer type like `Vec`, andPatrick Walton-12/+16
port all code over to use it.
2014-04-06De-~[] Mem{Reader,Writer}Steven Fackler-9/+9
2014-04-06De-~[] Reader and WriterSteven Fackler-2/+2
There's a little more allocation here and there now since from_utf8_owned can't be used with Vec.
2014-03-31serialize: Switch field privacy as necessaryAlex Crichton-8/+8
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`