1242 Commits

Author SHA1 Message Date
David Tolnay
379412b138 Release 1.0.71 v1.0.71 2021-11-17 12:41:32 -08:00
David Tolnay
4125560711 Consolidate unsafe RawValue transmutes in one place 2021-11-17 12:36:54 -08:00
David Tolnay
dee8161ce5 Merge pull request #824 from jplatte/box-raw-value-to-underlying
Add impl From<Box<RawValue>> for Box<str>
2021-11-17 12:33:46 -08:00
David Tolnay
584f47674a Merge pull request #821 from timothee-haudebourg/get_key_value
Add `Map::get_key_value` method.
2021-11-17 12:33:19 -08:00
Timothée Haudebourg
1ae5566f01 Disable get_key_value with older Rust versions. 2021-11-17 14:21:56 +01:00
Jonas Platte
37fe6b5fa8 Add impl From<Box<RawValue>> for Box<str>
Similar to the std impl From<Box<str>> for Box<[u8]>:
https://doc.rust-lang.org/std/boxed/struct.Box.html#impl-From%3CBox%3Cstr%2C%20A%3E%3E
2021-11-13 23:19:00 +01:00
David Tolnay
a050481b85 Release 1.0.70 v1.0.70 2021-11-12 19:08:47 -08:00
David Tolnay
24f85d2ecf Reorder Map::retain to keep keys() and values() adjacent 2021-11-12 19:07:26 -08:00
David Tolnay
37da27fc77 Merge pull request 822 from deankarn/master 2021-11-12 19:05:05 -08:00
Dean Karn
2e5b990995 Merge branch 'master' of github.com:deankarn/json 2021-11-12 18:58:11 -08:00
Dean Karn
debd7d07fc remove duplicate function 2021-11-12 18:58:00 -08:00
Dean Karn
9e36f611db Update build.rs
Co-authored-by: David Tolnay <dtolnay@gmail.com>
2021-11-12 18:49:45 -08:00
Dean Karn
68d3b45c97 fix function signature 2021-11-11 22:00:21 -08:00
Dean Karn
29a58a3077 don't include indexmap retain without BTreeMap retain 2021-11-11 21:54:09 -08:00
Dean Karn
eaa1a319c0 fix no_btreemap_retain name 2021-11-11 21:36:52 -08:00
Dean Karn
09c5892433 test order 2021-11-11 21:29:42 -08:00
Dean Karn
0992b44721 only include retain for BTreeMap if Rust 1.53.0+ 2021-11-11 21:19:51 -08:00
Dean Karn
d275e04a77 Add retain to Map
This adds the `retain` function to the Map type which calls the inner
maps, Either indexmap or std BTreeMap's, retain.

I'm trying to mutate a Value::Object's Map in-place and could't find a
nice way without the retain function.
2021-11-11 20:24:37 -08:00
Timothée Haudebourg
c4b6b97ccb Add Map::get_key_value method. 2021-11-11 14:00:55 +01:00
David Tolnay
5c4f8b2254 Release 1.0.69 v1.0.69 2021-11-05 12:38:49 -07:00
David Tolnay
0035947522 Touch up PR 814 2021-11-05 12:25:12 -07:00
David Tolnay
a28b1b1934 Merge pull request #814 from timothee-haudebourg/hash-numbers-only
Implement `Hash` for `Number`.
2021-11-05 12:11:42 -07:00
Timothée Haudebourg
f53ae31df6 Use the same hash for +0 and -0. 2021-11-05 12:57:41 +01:00
David Tolnay
8b35517540 Revert "Disable broken fuzz build in CI"
This reverts commit 5bae82d2d2.
2021-10-22 19:19:15 -07:00
Timothée Haudebourg
d12fbb9520 Fix NaN typo. 2021-10-20 14:25:51 +02:00
Timothée Haudebourg
48393aba40 Better justification for the use of f64::to_bits 2021-10-20 14:24:58 +02:00
Timothée Haudebourg
9046e3fa86 Avoid Self:: for older Rust versions.
Also fix a clippy warning.
2021-10-20 14:16:49 +02:00
Timothée Haudebourg
c3ac6c0077 Manual implementation of Number's PartialEq.
To please clippy.
2021-10-20 14:13:14 +02:00
Timothée Haudebourg
10655c7639 Use core::hash instead of std::hash. 2021-10-20 14:05:45 +02:00
Timothée Haudebourg
d153b886e8 Discard ordered_float, use custom Hash impl. 2021-10-20 14:02:21 +02:00
Timothée Haudebourg
eec4e9d272 Do not import ordered_float default features. 2021-10-20 13:42:01 +02:00
Timothée Haudebourg
b59c0c0e55 Do not import always NotNan.
Skip it when `arbitrary_precision` is enabled.
2021-10-20 13:41:42 +02:00
Timothée Haudebourg
be2f5738ba Do not show NotNan in Number's Debug impl. 2021-10-20 13:31:18 +02:00
Timothée Haudebourg
40ace5add9 ImplEq+Hash for Number using ordered_float. 2021-10-20 13:19:37 +02:00
David Tolnay
2e1c46c895 Update ui test suite to nightly-2021-10-17 2021-10-16 19:20:52 -07:00
David Tolnay
019b179cf7 Ui test changes for trybuild 1.0.49 2021-10-08 03:00:04 -04:00
David Tolnay
733b353394 Update ui test files 2021-10-07 00:19:07 -04:00
David Tolnay
f7a25e062a Declare minimum Rust version in Cargo metadata 2021-10-02 02:31:21 -04:00
David Tolnay
552a6ee83e Resolve semicolon_if_nothing_returned pedantic clippy lint
error: consider adding a `;` to the last statement for consistent formatting
       --> src/read.rs:680:9
        |
    680 |         self.delegate.begin_raw_buffering()
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.delegate.begin_raw_buffering();`
        |
        = note: `-D clippy::semicolon-if-nothing-returned` implied by `-D clippy::pedantic`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
       --> src/read.rs:756:9
        |
    756 |         R::begin_raw_buffering(self)
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `R::begin_raw_buffering(self);`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
2021-10-01 01:18:17 -04:00
David Tolnay
9a6dcf03de Resolve redundant_closure_for_method_calls pedantic clippy lint
error: redundant closure
       --> src/number.rs:133:69
        |
    133 |                     return self.n.parse::<f64>().ok().map_or(false, |f| f.is_finite());
        |                                                                     ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `f64::is_finite`
        |
        = note: `-D clippy::redundant-closure-for-method-calls` implied by `-D clippy::pedantic`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
2021-10-01 01:17:35 -04:00
David Tolnay
f5f23f9b7f Resolve needless_borrow clippy lint
error: this expression borrows a reference (`&mut ser::Serializer<W, F>`) that is immediately dereferenced by the compiler
       --> src/ser.rs:759:59
        |
    759 |                     tri!(value.serialize(NumberStrEmitter(&mut *ser)));
        |                                                           ^^^^^^^^^ help: change this to: `*ser`
        |
        = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

    error: this expression borrows a reference (`&mut ser::Serializer<W, F>`) that is immediately dereferenced by the compiler
       --> src/ser.rs:768:61
        |
    768 |                     tri!(value.serialize(RawValueStrEmitter(&mut *ser)));
        |                                                             ^^^^^^^^^ help: change this to: `*ser`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
2021-10-01 01:16:56 -04:00
David Tolnay
28fc9b4ddf Run clippy also with features enabled 2021-10-01 01:15:43 -04:00
David Tolnay
9298f54ace Resolve manual_str_repeat clippy lint 2021-10-01 01:11:06 -04:00
David Tolnay
019041e4d5 Resolve semicolon_if_nothing_returned pedantic clippy lint
error: consider adding a `;` to the last statement for consistent formatting
       --> tests/../src/lexical/float.rs:111:9
        |
    111 |         round_to_native::<F, _>(self, algorithm)
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `round_to_native::<F, _>(self, algorithm);`
        |
        = note: `-D clippy::semicolon-if-nothing-returned` implied by `-D clippy::pedantic`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
       --> tests/../src/lexical/math.rs:616:9
        |
    616 |         iadd_impl(x, y, 0)
        |         ^^^^^^^^^^^^^^^^^^ help: add a `;` here: `iadd_impl(x, y, 0);`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
       --> tests/../src/lexical/math.rs:862:9
        |
    862 |         self.ishl(n as usize)
        |         ^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.ishl(n as usize);`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
       --> tests/../src/lexical/math.rs:868:9
        |
    868 |         small::imul_pow5(self.data_mut(), n)
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `small::imul_pow5(self.data_mut(), n);`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
       --> tests/lexical/float.rs:184:5
        |
    184 |     check_round_to_f64(10234494226754558294, -1086, 2498655817078750, -1074)
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `check_round_to_f64(10234494226754558294, -1086, 2498655817078750, -1074);`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
2021-10-01 01:09:12 -04:00
David Tolnay
0b5931550a Resolve needless_borrow clippy lint
error: this expression borrows a reference (`&lexical::float::ExtendedFloat`) that is immediately dereferenced by the compiler
       --> tests/../src/lexical/algorithm.rs:136:45
        |
    136 |         u64::error_is_accurate::<F>(errors, &fp)
        |                                             ^^^ help: change this to: `fp`
        |
        = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
2021-10-01 01:07:42 -04:00
David Tolnay
fc4db0306a Run clippy on test suite too 2021-10-01 00:46:45 -04:00
David Tolnay
cf15614994 Move clippy lint level to CI job 2021-10-01 00:40:33 -04:00
David Tolnay
5a6af19aae Skip clippy job on pull requests 2021-10-01 00:39:06 -04:00
David Tolnay
5bae82d2d2 Disable broken fuzz build in CI
https://github.com/rust-fuzz/cargo-fuzz/issues/276
2021-09-25 21:17:56 -07:00
David Tolnay
9420d3a0a4 Release 1.0.68 v1.0.68 2021-09-14 13:12:44 -07:00