summary refs log tree commit diff
path: root/src/libserialize/json.rs
AgeCommit message (Collapse)AuthorLines
2014-06-26json: Fix handling of NaN/Infinitymrec-6/+51
The JSON spec requires that these special values be serialized as null; the current serialization breaks any conformant JSON parser. So encoding needs to output "null", to_json on floating-point types can return Null as well as Number, and reading null when specifically expecting a number should be interpreted as NaN. There's no way to round-trip Infinity.
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-10/+10
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-21serialize: Simplify the json docsErick Tryzelaar-1/+1
2014-06-18Remove TraitStore from ty_traitNick Cameron-7/+14
Use ty_rptr/ty_uniq(ty_trait) rather than TraitStore to represent trait types. Also addresses (but doesn't close) #12470. Part of the work towards DST (#12938). [breaking-change] lifetime parameters in `&mut trait` are now invariant. They used to be contravariant.
2014-06-16Update "use" to "uses" ln186theptrk-1/+1
2014-06-16auto merge of #14932 : Sawyer47/rust/json-smallfix, r=huonwbors-5/+1
2014-06-15Register new snapshotsAlex Crichton-68/+0
2014-06-15Small improvement for json PrettyEncoderPiotr Jawniak-5/+1
2014-06-13auto merge of #14831 : alexcrichton/rust/format-intl, r=brsonbors-0/+68
* The select/plural methods from format strings are removed * The # character no longer needs to be escaped * The \-based escapes have been removed * '{{' is now an escape for '{' * '}}' is now an escape for '}' Closes #14810 [breaking-change]
2014-06-11std: Remove i18n/l10n from format!Alex Crichton-0/+68
* The select/plural methods from format strings are removed * The # character no longer needs to be escaped * The \-based escapes have been removed * '{{' is now an escape for '{' * '}}' is now an escape for '}' Closes #14810 [breaking-change]
2014-06-11rustc: Remove ~[T] from the languageAlex Crichton-91/+89
The following features have been removed * box [a, b, c] * ~[a, b, c] * box [a, ..N] * ~[a, ..N] * ~[T] (as a type) * deprecated_owned_vector lint All users of ~[T] should move to using Vec<T> instead.
2014-06-08Fix spelling errors in comments.Joseph Crail-3/+3
2014-06-05Fallout from the libcollections movementAlex Crichton-14/+8
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