about summary refs log tree commit diff
path: root/src/libserialize/json.rs
AgeCommit message (Collapse)AuthorLines
2016-08-31Rollup merge of #36123 - nagisa:unignore-json-tests, r=alexcrichtonJonathan Turner-3/+0
Unignore the json tests on 32-bit platforms cc #14064 r? @alexcrichton
2016-08-30Unignore the json tests on 32-bit platformsSimonas Kazlauskas-3/+0
cc #14064
2016-08-25Rename {uint,int} methods to {usize,isize}.Corey Farwell-6/+6
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-6/+4
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-05-09Utilize `Result::unwrap_err` in more places.Corey Farwell-1/+1
2016-03-22try! -> ?Jorge Aparicio-90/+90
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-22std: Change `encode_utf{8,16}` to return iteratorsAlex Crichton-4/+3
Currently these have non-traditional APIs which take a buffer and report how much was filled in, but they're not necessarily ergonomic to use. Returning an iterator which *also* exposes an underlying slice shouldn't result in any performance loss as it's just a lazy version of the same implementation, and it's also much more ergonomic! cc #27784
2016-02-18Remove unnecessary explicit lifetime bounds.Corey Farwell-4/+4
These explicit lifetimes can be ommitted because of lifetime elision rules. Instances were found using rust-clippy.
2016-01-26Fix warnings during testsAlex Crichton-1/+0
The deny(warnings) attribute is now enabled for tests so we need to weed out these warnings as well.
2015-11-12libserialize: deny warnings in doctestsKevin Butler-3/+6
2015-09-20Miscellaneous cleanup for old issues.Lee Jeffery-6/+3
2015-09-08fixes/improvements thanks to @ManishearthAndre Bogus-3/+3
2015-09-08some more clippy-based improvementsAndre Bogus-53/+52
2015-08-23Refactor low-level UTF-16 decoding.Simon Sapin-6/+6
* Rename `utf16_items` to `decode_utf16`. "Items" is meaningless. * Move it to `rustc_unicode::char`, exposed in `std::char`. * Generalize it to any `u16` iterable, not just `&[u16]`. * Make it yield `Result` instead of a custom `Utf16Item` enum that was isomorphic to `Result`. This enable using the `FromIterator for Result` impl. * Add a `REPLACEMENT_CHARACTER` constant. * Document how `result.unwrap_or(REPLACEMENT_CHARACTER)` replaces `Utf16Item::to_char_lossy`.
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-1/+0
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-06-08Replace usage of String::from_str with String:fromSimon Sapin-1/+1
2015-05-30fix documentation in libserializebenaryorg-1/+1
the object was serialized with an 'i' but the comment stated the print command would output 'j'
2015-05-06test: update tests for flt2dec fallouts.Kang Seonghoon-2/+2
2015-04-21rollup merge of #24636: alexcrichton/remove-deprecatedAlex Crichton-18/+10
Conflicts: src/libcore/result.rs
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-18/+10
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change]
2015-04-21Remove references to `old_{path,io}`Tamir Duberstein-1/+1
2015-04-18Auto merge of #24428 - kwantam:deprecate_unicode_fns, r=alexcrichtonbors-2/+2
This patch 1. renames libunicode to librustc_unicode, 2. deprecates several pieces of libunicode (see below), and 3. removes references to deprecated functions from librustc_driver and libsyntax. This may change pretty-printed output from these modules in cases involving wide or combining characters used in filenames, identifiers, etc. The following functions are marked deprecated: 1. char.width() and str.width(): --> use unicode-width crate 2. str.graphemes() and str.grapheme_indices(): --> use unicode-segmentation crate 3. str.nfd_chars(), str.nfkd_chars(), str.nfc_chars(), str.nfkc_chars(), char.compose(), char.decompose_canonical(), char.decompose_compatible(), char.canonical_combining_class(): --> use unicode-normalization crate
2015-04-17Workaround deliberate overflowing negation in serialize::json.Felix S. Klock II-1/+1
2015-04-16deprecate Unicode functions that will be moved to crates.iokwantam-2/+2
This patch 1. renames libunicode to librustc_unicode, 2. deprecates several pieces of libunicode (see below), and 3. removes references to deprecated functions from librustc_driver and libsyntax. This may change pretty-printed output from these modules in cases involving wide or combining characters used in filenames, identifiers, etc. The following functions are marked deprecated: 1. char.width() and str.width(): --> use unicode-width crate 2. str.graphemes() and str.grapheme_indices(): --> use unicode-segmentation crate 3. str.nfd_chars(), str.nfkd_chars(), str.nfc_chars(), str.nfkc_chars(), char.compose(), char.decompose_canonical(), char.decompose_compatible(), char.canonical_combining_class(): --> use unicode-normalization crate
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-1/+1
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-14test: Fixup many library unit testsAlex Crichton-3/+1
2015-04-01Fallout in public-facing and semi-public-facing libsNiko Matsakis-1/+1
2015-03-31rollup merge of #23879: seanmonstar/del-from-errorAlex Crichton-2/+2
Conflicts: src/libcore/error.rs
2015-03-31rollup merge of #23886: demelev/remove_as_slice_usageAlex Crichton-1/+1
2015-03-31Stabilize std::numAaron Turon-0/+3
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change]
2015-03-30convert: remove FromError, use From<E> insteadSean McArthur-2/+2
This removes the FromError trait, since it can now be expressed using the new convert::Into trait. All implementations of FromError<E> where changed to From<E>, and `try!` was changed to use From::from instead. Because this removes FromError, it is a breaking change, but fixing it simply requires changing the words `FromError` to `From`, and `from_error` to `from`. [breaking-change]
2015-03-31replace deprecated as_slice()Emeliov Dmitrii-1/+1
2015-03-28Rollup merge of #23803 - richo:unused-braces, r=ManishearthManish Goregaokar-1/+1
Pretty much what it says on the tin.
2015-03-28cleanup: Remove unused braces in use statementsRicho Healey-1/+1
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-95/+95
Conflicts: src/librustc/middle/ty.rs src/librustc_trans/trans/adt.rs src/librustc_typeck/check/mod.rs src/libserialize/json.rs src/test/run-pass/spawn-fn.rs
2015-03-27rollup merge of #23738: alexcrichton/snapshotsAlex Crichton-23/+0
Conflicts: src/libcollections/vec.rs
2015-03-27Change the trivial cast lints to allow by defaultNick Cameron-2/+0
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-98/+98
Now that support has been removed, all lingering use cases are renamed.
2015-03-26Register new snapshotsAlex Crichton-23/+0
2015-03-25Change lint names to pluralsNick Cameron-2/+2
2015-03-25Add trivial cast lints.Nick Cameron-2/+8
This permits all coercions to be performed in casts, but adds lints to warn in those cases. Part of this patch moves cast checking to a later stage of type checking. We acquire obligations to check casts as part of type checking where we previously checked them. Once we have type checked a function or module, then we check any cast obligations which have been acquired. That means we have more type information available to check casts (this was crucial to making coercions work properly in place of some casts), but it means that casts cannot feed input into type inference. [breaking change] * Adds two new lints for trivial casts and trivial numeric casts, these are warn by default, but can cause errors if you build with warnings as errors. Previously, trivial numeric casts and casts to trait objects were allowed. * The unused casts lint has gone. * Interactions between casting and type inference have changed in subtle ways. Two ways this might manifest are: - You may need to 'direct' casts more with extra type information, for example, in some cases where `foo as _ as T` succeeded, you may now need to specify the type for `_` - Casts do not influence inference of integer types. E.g., the following used to type check: ``` let x = 42; let y = &x as *const u32; ``` Because the cast would inform inference that `x` must have type `u32`. This no longer applies and the compiler will fallback to `i32` for `x` and thus there will be a type error in the cast. The solution is to add more type information: ``` let x: u32 = 42; let y = &x as *const u32; ```
2015-03-23Adjust Index/IndexMut impls. For generic collections, we takeNiko Matsakis-0/+23
references. For collections whose keys are integers, we take both references and by-value.
2015-03-20std: Remove old_io/old_path from the preludeAlex Crichton-0/+1
This commit removes the reexports of `old_io` traits as well as `old_path` types and traits from the prelude. This functionality is now all deprecated and needs to be removed to make way for other functionality like `Seek` in the `std::io` module (currently reexported as `NewSeek` in the io prelude). Closes #23377 Closes #23378
2015-03-18Register new snapshotsAlex Crichton-2/+0
2015-03-16impl f{32,64}Jorge Aparicio-1/+1
2015-03-13Fallout of std::old_io deprecationAlex Crichton-13/+16
2015-03-09doc: Fix extraneous as_slice()'s in docstringsRicho Healey-1/+1
2015-03-05Remove integer suffixes where the types in compiled code are identical.Eduard Burtescu-1/+1
2015-03-03Accommodate arith-overflow in serialize::json numeric parsing.Felix S. Klock II-2/+2
2015-02-26remove some compiler warningsTshepang Lekhonkhobe-2/+0