about summary refs log tree commit diff
path: root/src/libserialize
AgeCommit message (Collapse)AuthorLines
2014-09-17rollup merge of #17276 : treeman/json-commaAlex Crichton-2/+10
2014-09-16Fallout from renamingAaron Turon-5/+5
2014-09-15json: Properly handle trailing comma error in object decoding.Jonas Hietala-2/+10
Closes #16945
2014-09-09Decoding json now defaults Option<_> to None.Jonas Hietala-1/+37
Closes #12794
2014-09-03Fix spelling errors and capitalization.Joseph Crail-1/+1
2014-08-30auto merge of #16859 : alexcrichton/rust/snapshots, r=huonwbors-1/+0
2014-08-29Register new snapshotsAlex Crichton-1/+0
2014-08-30Unify non-snake-case lints and non-uppercase statics lintsP1start-3/+3
This unifies the `non_snake_case_functions` and `uppercase_variables` lints into one lint, `non_snake_case`. It also now checks for non-snake-case modules. This also extends the non-camel-case types lint to check type parameters, and merges the `non_uppercase_pattern_statics` lint into the `non_uppercase_statics` lint. Because the `uppercase_variables` lint is now part of the `non_snake_case` lint, all non-snake-case variables that start with lowercase characters (such as `fooBar`) will now trigger the `non_snake_case` lint. New code should be updated to use the new `non_snake_case` lint instead of the previous `non_snake_case_functions` and `uppercase_variables` lints. All use of the `non_uppercase_pattern_statics` should be replaced with the `non_uppercase_statics` lint. Any code that previously contained non-snake-case module or variable names should be updated to use snake case names or disable the `non_snake_case` lint. Any code with non-camel-case type parameters should be changed to use camel case or disable the `non_camel_case_types` lint. [breaking-change]
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-2/+3
2014-08-26Rebasing changesNick Cameron-1/+0
2014-08-26Use temp vars for implicit coercion to ^[T]Nick Cameron-2/+3
2014-08-26Use the slice repr for ~[T]Nick Cameron-0/+1
2014-08-21Parameterize indent in PrettyEncoderAustin Bonander-18/+85
2014-08-20auto merge of #16621 : tshepang/rust/grammar, r=steveklabnikbors-1/+1
2014-08-20doc: grammar fixesTshepang Lekhonkhobe-1/+1
2014-08-19Don't fail if an object is keyed with a string and we're expecting a numberErick Tryzelaar-2/+24
2014-08-19serialize: add json bounds checks, support for u64s, and testsErick Tryzelaar-142/+266
2014-08-19serialize: add json::{Integer,Floating} to parse large integers properlyErick Tryzelaar-107/+200
[breaking-change]
2014-08-11Reenable ignored test and add run-pass test.Luqman Aden-1/+0
2014-08-10remove outdated commentChuck Ries-2/+0
These are already coded as traits.
2014-08-06Remove cast to char in libserialize::hexnham-5/+5
2014-08-06Use byte literals in libserializenham-10/+10
2014-07-31libserialize: add `error()` to `Decoder`Andrew Poelstra-0/+8
A quick and dirty fix for #15036 until we get serious decoder reform. Right now it is impossible for a Decodable to signal a decode error, for example if it has only finitely many allowed values, is a string which must be encoded a certain way, needs a valid checksum, etc. For example in the libuuid implementation of Decodable an Option is unwrapped, meaning that a decode of a malformed UUID will cause the task to fail. Since this adds a method to the `Decoder` trait, all users will need to update their implementations to add it. The strategy used for the current implementations for JSON and EBML is to add a new entry to the error enum `ApplicationError(String)` which stores the string provided to `.error()`. [breaking-change]
2014-07-31remove serialize::ebml, add librbmlErick Tryzelaar-1296/+0
Our implementation of ebml has diverged from the standard in order to better serve the needs of the compiler, so it doesn't make much sense to call what we have ebml anyore. Furthermore, our implementation is pretty crufty, and should eventually be rewritten into a format that better suits the needs of the compiler. This patch factors out serialize::ebml into librbml, otherwise known as the Really Bad Markup Language. This is a stopgap library that shouldn't be used by end users, and will eventually be replaced by something better. [breaking-change]
2014-07-29remove seek from std::io::MemWriter, add SeekableMemWriter to librustcErick Tryzelaar-2/+118
Not all users of MemWriter need to seek, but having MemWriter seekable adds between 3-29% in overhead in certain circumstances. This fixes that performance gap by making a non-seekable MemWriter, and creating a new SeekableMemWriter for those circumstances when that functionality is actually needed. ``` test io::mem::test::bench_buf_reader ... bench: 682 ns/iter (+/- 85) test io::mem::test::bench_buf_writer ... bench: 580 ns/iter (+/- 57) test io::mem::test::bench_mem_reader ... bench: 793 ns/iter (+/- 99) test io::mem::test::bench_mem_writer_001_0000 ... bench: 48 ns/iter (+/- 27) test io::mem::test::bench_mem_writer_001_0010 ... bench: 65 ns/iter (+/- 27) = 153 MB/s test io::mem::test::bench_mem_writer_001_0100 ... bench: 132 ns/iter (+/- 12) = 757 MB/s test io::mem::test::bench_mem_writer_001_1000 ... bench: 802 ns/iter (+/- 151) = 1246 MB/s test io::mem::test::bench_mem_writer_100_0000 ... bench: 481 ns/iter (+/- 28) test io::mem::test::bench_mem_writer_100_0010 ... bench: 1957 ns/iter (+/- 126) = 510 MB/s test io::mem::test::bench_mem_writer_100_0100 ... bench: 8222 ns/iter (+/- 434) = 1216 MB/s test io::mem::test::bench_mem_writer_100_1000 ... bench: 82496 ns/iter (+/- 11191) = 1212 MB/s test io::mem::test::bench_seekable_mem_writer_001_0000 ... bench: 48 ns/iter (+/- 2) test io::mem::test::bench_seekable_mem_writer_001_0010 ... bench: 64 ns/iter (+/- 2) = 156 MB/s test io::mem::test::bench_seekable_mem_writer_001_0100 ... bench: 129 ns/iter (+/- 7) = 775 MB/s test io::mem::test::bench_seekable_mem_writer_001_1000 ... bench: 801 ns/iter (+/- 159) = 1248 MB/s test io::mem::test::bench_seekable_mem_writer_100_0000 ... bench: 711 ns/iter (+/- 51) test io::mem::test::bench_seekable_mem_writer_100_0010 ... bench: 2532 ns/iter (+/- 227) = 394 MB/s test io::mem::test::bench_seekable_mem_writer_100_0100 ... bench: 8962 ns/iter (+/- 947) = 1115 MB/s test io::mem::test::bench_seekable_mem_writer_100_1000 ... bench: 85086 ns/iter (+/- 11555) = 1175 MB/s ``` [breaking-change]
2014-07-29serialize: fix a warningErick Tryzelaar-1/+1
2014-07-24Deprecated `str::raw::from_utf8_owned`Adolfo Ochagavía-4/+4
Replaced by `string::raw::from_utf8` [breaking-change]
2014-07-23Convert some push_back users to pushBrian Anderson-3/+3
2014-07-22auto merge of #15867 : cmr/rust/rewrite-lexer4, r=alexcrichtonbors-0/+4
2014-07-21ignore-lexer-test to broken files and remove some tray hyphensCorey Richardson-0/+4
I blame @ChrisMorgan for the hyphens.
2014-07-19Implement FromBase64 for &[u8].Simon Sapin-17/+29
The algorithm was already based on bytes internally. Also use byte literals instead of casting u8 to char for matching.
2014-07-18Ignore one test.Luqman Aden-0/+1
2014-07-17auto merge of #15675 : errordeveloper/rust/json_docs, r=steveklabnikbors-16/+71
- add one simple example of using `ToJson` trait - make example code more readable
2014-07-17deprecate Vec::getNick Cameron-1/+1
2014-07-16Improve docs on JSON.Ilya Dmitrichenko-16/+71
- add one simple example of using `ToJson` trait - make example code more readable
2014-07-15Deprecate `str::from_utf8_owned`Adolfo Ochagavía-13/+11
Use `String::from_utf8` instead [breaking-change]
2014-07-11Update doc URLs for version bumpBrian Anderson-1/+1
2014-07-09Register new snapshotsAlex Crichton-2/+0
Closes #15544
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-20/+20
[breaking-change]
2014-07-07auto merge of #15411 : mitchmindtree/rust/master, r=alexcrichtonbors-0/+30
I ran `make check` and everything went smoothly. I also tested `#[deriving(Decodable, Encodable)]` on a struct containing both Cell<T> and RefCell<T> and everything now seems to work fine.
2014-07-07Implemented Decodable/Encodable for Cell and RefCell. Fixes #15395mitchmindtree-0/+30
Updated PR with fixme and test Updated PR with fixme and test
2014-07-05Add #[crate_name] attributes as necessaryAlex Crichton-1/+3
2014-07-05auto merge of #15419 : erickt/rust/json, r=pcwaltonbors-37/+87
This speeds up json serialization by removing most of the allocations.
2014-07-04serialize: speed up json pretty printing by batch writing spacesErick Tryzelaar-4/+13
2014-07-04serialize: escaping json strings should write in batches.Erick Tryzelaar-15/+31
This significantly speeds up encoding json strings.
2014-07-04serialize: Remove allocations from escaping strs and indenting spacesErick Tryzelaar-38/+63
2014-07-04librustc: Remove the `&LIFETIME EXPR` production from the language.Patrick Walton-1/+1
This was parsed by the parser but completely ignored; not even stored in the AST! This breaks code that looks like: static X: &'static [u8] = &'static [1, 2, 3]; Change this code to the shorter: static X: &'static [u8] = &[1, 2, 3]; Closes #15312. [breaking-change]
2014-07-02Merge remote-tracking branch 'origin/master' into 0.11.0-releaseAlex Crichton-526/+314
Conflicts: src/libstd/lib.rs
2014-06-30Implement ToJson for all tuplesAdolfo Ochagavía-14/+26
2014-06-30Fix JSON documentationAdolfo Ochagavía-127/+40
Fixed some errors, removed some code examples and added usage of the `encode` and `decode` functions.