1791 Commits

Author SHA1 Message Date
Aatif Syed
9206cc0150 feat: impl Default for &Value 2025-06-18 10:02:07 +01:00
David Tolnay
cd55b5a0ff
Ignore mismatched_lifetime_syntaxes lint
warning: lifetime flowing from input to output with different syntax can be confusing
       --> src/map.rs:274:21
        |
    274 |     pub fn entry<S>(&mut self, key: S) -> Entry
        |                     ^^^^^^^^^             ----- the lifetime gets resolved as `'_`
        |                     |
        |                     this lifetime flows to the output
        |
        = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
    help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
        |
    274 |     pub fn entry<S>(&mut self, key: S) -> Entry<'_>
        |                                                ++++

    warning: lifetime flowing from input to output with different syntax can be confusing
       --> src/map.rs:303:17
        |
    303 |     pub fn iter(&self) -> Iter {
        |                 ^^^^^     ---- the lifetime gets resolved as `'_`
        |                 |
        |                 this lifetime flows to the output
        |
    help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
        |
    303 |     pub fn iter(&self) -> Iter<'_> {
        |                               ++++

    warning: lifetime flowing from input to output with different syntax can be confusing
       --> src/map.rs:311:21
        |
    311 |     pub fn iter_mut(&mut self) -> IterMut {
        |                     ^^^^^^^^^     ------- the lifetime gets resolved as `'_`
        |                     |
        |                     this lifetime flows to the output
        |
    help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
        |
    311 |     pub fn iter_mut(&mut self) -> IterMut<'_> {
        |                                          ++++

    warning: lifetime flowing from input to output with different syntax can be confusing
       --> src/map.rs:319:17
        |
    319 |     pub fn keys(&self) -> Keys {
        |                 ^^^^^     ---- the lifetime gets resolved as `'_`
        |                 |
        |                 this lifetime flows to the output
        |
    help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
        |
    319 |     pub fn keys(&self) -> Keys<'_> {
        |                               ++++

    warning: lifetime flowing from input to output with different syntax can be confusing
       --> src/map.rs:327:19
        |
    327 |     pub fn values(&self) -> Values {
        |                   ^^^^^     ------ the lifetime gets resolved as `'_`
        |                   |
        |                   this lifetime flows to the output
        |
    help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
        |
    327 |     pub fn values(&self) -> Values<'_> {
        |                                   ++++

    warning: lifetime flowing from input to output with different syntax can be confusing
       --> src/map.rs:335:23
        |
    335 |     pub fn values_mut(&mut self) -> ValuesMut {
        |                       ^^^^^^^^^     --------- the lifetime gets resolved as `'_`
        |                       |
        |                       this lifetime flows to the output
        |
    help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
        |
    335 |     pub fn values_mut(&mut self) -> ValuesMut<'_> {
        |                                              ++++

    warning: lifetime flowing from input to output with different syntax can be confusing
        --> src/value/de.rs:1388:19
         |
    1388 |     fn unexpected(&self) -> Unexpected {
         |                   ^^^^^     ---------- the lifetime gets resolved as `'_`
         |                   |
         |                   this lifetime flows to the output
         |
    help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
         |
    1388 |     fn unexpected(&self) -> Unexpected<'_> {
         |                                       ++++

    warning: lifetime flowing from input to output with different syntax can be confusing
       --> src/number.rs:798:30
        |
    798 |     pub(crate) fn unexpected(&self) -> Unexpected {
        |                              ^^^^^     ---------- the lifetime gets resolved as `'_`
        |                              |
        |                              this lifetime flows to the output
        |
    help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
        |
    798 |     pub(crate) fn unexpected(&self) -> Unexpected<'_> {
        |                                                  ++++
2025-06-05 22:08:47 -07:00
David Tolnay
c1826ebccc
Pin nightly toolchain used for miri job 2025-05-17 23:15:06 +02:00
David Tolnay
8a56cfa6d0
Merge pull request #1248 from jimmycathy/master
chore: fix typo
2025-03-16 00:03:58 -07:00
jimmycathy
af3d80de56 chore: fix typo
Signed-off-by: jimmycathy <clonecode@outlook.com>
2025-03-16 13:25:00 +08:00
David Tolnay
762783414e
Release 1.0.140 v1.0.140 2025-03-03 01:04:12 -08:00
David Tolnay
d77a498c80
Merge pull request #1245 from serde-rs/powerpc
Delete unused gcc installation
2025-03-03 04:03:47 -05:00
David Tolnay
b34d317089
Delete unused gcc installation 2025-03-03 00:51:16 -08:00
David Tolnay
f7200c3cf6
Ignore unbuffered_bytes clippy lint
warning: calling .bytes() is very inefficient when data is not in memory
       --> src/read.rs:202:40
        |
    202 |             iter: LineColIterator::new(reader.bytes()),
        |                                        ^^^^^^^^^^^^^^
        |
        = help: consider using `BufReader`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unbuffered_bytes
        = note: `-W clippy::unbuffered-bytes` implied by `-W clippy::all`
        = help: to override `-W clippy::all` add `#[allow(clippy::unbuffered_bytes)]`
2025-03-03 00:04:06 -08:00
David Tolnay
76cd4fb383
Ignore elidable_lifetime_names pedantic clippy lint
warning: the following explicit lifetimes could be elided: 'a
        --> src/de.rs:2189:11
         |
    2189 | impl<'de, 'a, R> MapKey<'a, R>
         |           ^^            ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
         = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic`
         = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]`
    help: elide the lifetimes
         |
    2189 - impl<'de, 'a, R> MapKey<'a, R>
    2189 + impl<'de, R> MapKey<'_, R>
         |

    warning: the following explicit lifetimes could be elided: 'a
        --> src/de.rs:2196:11
         |
    2196 | impl<'de, 'a, R> de::Deserializer<'de> for MapKey<'a, R>
         |           ^^                                      ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
         |
    2196 - impl<'de, 'a, R> de::Deserializer<'de> for MapKey<'a, R>
    2196 + impl<'de, R> de::Deserializer<'de> for MapKey<'_, R>
         |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/error.rs:467:6
        |
    467 | impl<'a> Display for JsonUnexpected<'a> {
        |      ^^                             ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    467 - impl<'a> Display for JsonUnexpected<'a> {
    467 + impl Display for JsonUnexpected<'_> {
        |

    warning: the following explicit lifetimes could be elided: 'de
       --> src/map.rs:601:6
        |
    601 | impl<'de> de::IntoDeserializer<'de, Error> for Map<String, Value> {
        |      ^^^                       ^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    601 - impl<'de> de::IntoDeserializer<'de, Error> for Map<String, Value> {
    601 + impl de::IntoDeserializer<'_, Error> for Map<String, Value> {
        |

    warning: the following explicit lifetimes could be elided: 'a
      --> src/ser.rs:31:6
       |
    31 | impl<'a, W> Serializer<W, PrettyFormatter<'a>>
       |      ^^                                   ^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
       |
    31 - impl<'a, W> Serializer<W, PrettyFormatter<'a>>
    31 + impl<W> Serializer<W, PrettyFormatter<'_>>
       |

    warning: the following explicit lifetimes could be elided: 'ser
       --> src/ser.rs:420:14
        |
    420 |         impl<'ser, W, F> Write for Adapter<'ser, W, F>
        |              ^^^^                          ^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    420 -         impl<'ser, W, F> Write for Adapter<'ser, W, F>
    420 +         impl<W, F> Write for Adapter<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:480:6
        |
    480 | impl<'a, W, F> ser::SerializeSeq for Compound<'a, W, F>
        |      ^^                                       ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    480 - impl<'a, W, F> ser::SerializeSeq for Compound<'a, W, F>
    480 + impl<W, F> ser::SerializeSeq for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:527:6
        |
    527 | impl<'a, W, F> ser::SerializeTuple for Compound<'a, W, F>
        |      ^^                                         ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    527 - impl<'a, W, F> ser::SerializeTuple for Compound<'a, W, F>
    527 + impl<W, F> ser::SerializeTuple for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:549:6
        |
    549 | impl<'a, W, F> ser::SerializeTupleStruct for Compound<'a, W, F>
        |      ^^                                               ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    549 - impl<'a, W, F> ser::SerializeTupleStruct for Compound<'a, W, F>
    549 + impl<W, F> ser::SerializeTupleStruct for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:571:6
        |
    571 | impl<'a, W, F> ser::SerializeTupleVariant for Compound<'a, W, F>
        |      ^^                                                ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    571 - impl<'a, W, F> ser::SerializeTupleVariant for Compound<'a, W, F>
    571 + impl<W, F> ser::SerializeTupleVariant for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:609:6
        |
    609 | impl<'a, W, F> ser::SerializeMap for Compound<'a, W, F>
        |      ^^                                       ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    609 - impl<'a, W, F> ser::SerializeMap for Compound<'a, W, F>
    609 + impl<W, F> ser::SerializeMap for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:681:6
        |
    681 | impl<'a, W, F> ser::SerializeStruct for Compound<'a, W, F>
        |      ^^                                          ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    681 - impl<'a, W, F> ser::SerializeStruct for Compound<'a, W, F>
    681 + impl<W, F> ser::SerializeStruct for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:727:6
        |
    727 | impl<'a, W, F> ser::SerializeStructVariant for Compound<'a, W, F>
        |      ^^                                                 ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    727 - impl<'a, W, F> ser::SerializeStructVariant for Compound<'a, W, F>
    727 + impl<W, F> ser::SerializeStructVariant for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:793:6
        |
    793 | impl<'a, W, F> ser::Serializer for MapKeySerializer<'a, W, F>
        |      ^^                                             ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    793 - impl<'a, W, F> ser::Serializer for MapKeySerializer<'a, W, F>
    793 + impl<W, F> ser::Serializer for MapKeySerializer<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
        --> src/ser.rs:1979:6
         |
    1979 | impl<'a> Default for PrettyFormatter<'a> {
         |      ^^                              ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
         |
    1979 - impl<'a> Default for PrettyFormatter<'a> {
    1979 + impl Default for PrettyFormatter<'_> {
         |

    warning: the following explicit lifetimes could be elided: 'a
        --> src/ser.rs:1985:6
         |
    1985 | impl<'a> Formatter for PrettyFormatter<'a> {
         |      ^^                                ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
         |
    1985 - impl<'a> Formatter for PrettyFormatter<'a> {
    1985 + impl Formatter for PrettyFormatter<'_> {
         |

    warning: the following explicit lifetimes could be elided: 'a, 'b
       --> src/value/mod.rs:227:14
        |
    227 |         impl<'a, 'b> io::Write for WriterFormatter<'a, 'b> {
        |              ^^  ^^                                ^^  ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    227 -         impl<'a, 'b> io::Write for WriterFormatter<'a, 'b> {
    227 +         impl io::Write for WriterFormatter<'_, '_> {
        |

    warning: the following explicit lifetimes could be elided: 'de
       --> src/value/de.rs:526:6
        |
    526 | impl<'de> IntoDeserializer<'de, Error> for Value {
        |      ^^^                   ^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    526 - impl<'de> IntoDeserializer<'de, Error> for Value {
    526 + impl IntoDeserializer<'_, Error> for Value {
        |

    warning: the following explicit lifetimes could be elided: 'de
        --> src/value/de.rs:1343:6
         |
    1343 | impl<'de> Visitor<'de> for KeyClassifier {
         |      ^^^          ^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
         |
    1343 - impl<'de> Visitor<'de> for KeyClassifier {
    1343 + impl Visitor<'_> for KeyClassifier {
         |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/value/index.rs:146:6
        |
    146 | impl<'a> Display for Type<'a> {
        |      ^^                   ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    146 - impl<'a> Display for Type<'a> {
    146 + impl Display for Type<'_> {
        |

    warning: the following explicit lifetimes could be elided: 'de
       --> src/number.rs:403:14
        |
    403 |         impl<'de> Visitor<'de> for NumberVisitor {
        |              ^^^          ^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    403 -         impl<'de> Visitor<'de> for NumberVisitor {
    403 +         impl Visitor<'_> for NumberVisitor {
        |

    warning: the following explicit lifetimes could be elided: 'b, 'c
       --> src/read.rs:132:6
        |
    132 | impl<'b, 'c, T> Deref for Reference<'b, 'c, T>
        |      ^^  ^^                         ^^  ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    132 - impl<'b, 'c, T> Deref for Reference<'b, 'c, T>
    132 + impl<T> Deref for Reference<'_, '_, T>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/read.rs:541:6
        |
    541 | impl<'a> private::Sealed for SliceRead<'a> {}
        |      ^^                                ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    541 - impl<'a> private::Sealed for SliceRead<'a> {}
    541 + impl private::Sealed for SliceRead<'_> {}
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/read.rs:679:6
        |
    679 | impl<'a> private::Sealed for StrRead<'a> {}
        |      ^^                              ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    679 - impl<'a> private::Sealed for StrRead<'a> {}
    679 + impl private::Sealed for StrRead<'_> {}
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/read.rs:833:6
        |
    833 | impl<'a> Fused for SliceRead<'a> {}
        |      ^^                      ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    833 - impl<'a> Fused for SliceRead<'a> {}
    833 + impl Fused for SliceRead<'_> {}
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/read.rs:834:6
        |
    834 | impl<'a> Fused for StrRead<'a> {}
        |      ^^                    ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    834 - impl<'a> Fused for StrRead<'a> {}
    834 + impl Fused for StrRead<'_> {}
        |

    warning: the following explicit lifetimes could be elided: 'de
      --> tests/regression/issue845.rs:12:6
       |
    12 | impl<'de, T> serde:🇩🇪:Visitor<'de> for NumberVisitor<T>
       |      ^^^                        ^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
       = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]`
    help: elide the lifetimes
       |
    12 - impl<'de, T> serde:🇩🇪:Visitor<'de> for NumberVisitor<T>
    12 + impl<T> serde:🇩🇪:Visitor<'_> for NumberVisitor<T>
       |
2025-03-03 00:02:55 -08:00
David Tolnay
400eaa977f
Point standard library links to stable 2025-02-20 05:24:48 -08:00
David Tolnay
4d4f53c3b7
Release 1.0.139 v1.0.139 2025-02-19 18:34:59 -08:00
David Tolnay
5d6b32f378
Merge pull request #1242 from dtolnay/writefloat
Document behavior of write_f32/f64 on non-finite floats
2025-02-19 18:34:30 -08:00
David Tolnay
e5bb8bd38f
Document behavior of write_f32/f64 on non-finite floats 2025-02-19 18:26:25 -08:00
David Tolnay
7a797810d2
Merge pull request #1241 from dtolnay/doclink
Convert html links to intra-doc links
2025-02-19 18:26:19 -08:00
David Tolnay
13591f1dd4
Convert html links to intra-doc links 2025-02-19 17:51:29 -08:00
David Tolnay
1d7378e8ee
Unset doc-scrape-examples for lib target
False is the default value since Cargo PR 11499.
2025-02-09 17:52:36 -08:00
David Tolnay
1174c5f57d
Resolve unnecessary_semicolon pedantic clippy lint
warning: unnecessary semicolon
       --> src/de.rs:371:10
        |
    371 |         };
        |          ^ help: remove
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon
        = note: `-W clippy::unnecessary-semicolon` implied by `-W clippy::pedantic`
        = help: to override `-W clippy::pedantic` add `#[allow(clippy::unnecessary_semicolon)]`
2025-01-29 18:20:18 -08:00
David Tolnay
c916099147
Release 1.0.138 v1.0.138 2025-01-28 09:31:20 -08:00
David Tolnay
dc29e4815d
Move BufReader to caller
The original read_user_from_stream function from PR 1237 is a bad
pattern because it results in silently dropping any data left in the
buffer on return. If we want to read anything else from the same
TcpStream after the JSON object, the buffer needs to go in the caller.
2025-01-28 09:22:50 -08:00
David Tolnay
29122f9ed7
Sort imports from PR 1237 2025-01-28 09:18:47 -08:00
David Tolnay
d33c1b527e
Merge pull request #1237 from JonathanBrouwer/master
Improve documentation for buffering around functions taking a reader
2025-01-28 09:18:00 -08:00
Jonathan Brouwer
8c2d8004b2
Add more warnings to apply buffering on docs of affected functions 2025-01-28 08:47:21 +01:00
Jonathan Brouwer
65bbd1aa2d
Fix example of from_reader not applying buffering when it should 2025-01-28 08:38:17 +01:00
David Tolnay
87f78da0f5
More precise gitignore patterns 2025-01-23 01:40:57 -08:00
David Tolnay
4134f119c0
Remove *.sw[po] from gitignore
This belongs in someone's global gitignore.
2025-01-22 19:37:18 -08:00
David Tolnay
c7626dbac2
Remove **/*.rs.bk from project-specific gitignore
Cargo stopped generating this in its project template 5 years ago. It
would belong in a global gitignore instead.
2025-01-22 19:30:32 -08:00
David Tolnay
eb49e28204
Release 1.0.137 v1.0.137 2025-01-19 15:11:21 -08:00
David Tolnay
51c48ab3b0
Merge pull request #1231 from dtolnay/playground
Enable "float_roundtrip" and "unbounded_depth" features in playground
2025-01-19 15:10:47 -08:00
David Tolnay
7d8f15b963
Enable "float_roundtrip" and "unbounded_depth" features in playground 2025-01-19 15:04:54 -08:00
David Tolnay
a46f14cf2e
Release 1.0.136 v1.0.136 2025-01-18 16:50:05 -08:00
David Tolnay
eb9f3f6387
Merge pull request #1230 from goffrie/patch-1
Use Map::with_capacity in value::Serializer::serialize_map
2025-01-18 16:49:16 -08:00
Geoffry Song
513e5b2f74
Use Map::with_capacity in value::Serializer::serialize_map 2025-01-18 15:38:08 -08:00
David Tolnay
9802c08d4e
Release 1.0.135 v1.0.135 2025-01-06 16:21:47 -08:00
David Tolnay
b97935fde2
Merge pull request #1226 from tisonkun/map-into-values
Add Map::into_values method
2025-01-06 16:21:14 -08:00
tison
d48c224d12
Add Map::into_values method
Signed-off-by: tison <wander4096@gmail.com>
2025-01-07 08:10:53 +08:00
David Tolnay
1e77cac742
Resolve precedence clippy lint
warning: operator precedence can trip the unwary
       --> src/read.rs:963:18
        |
    963 |         let n = (((n1 - 0xD800) as u32) << 10 | (n2 - 0xDC00) as u32) + 0x1_0000;
        |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(((n1 - 0xD800) as u32) << 10) | (n2 - 0xDC00) as u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
        = note: `-W clippy::precedence` implied by `-W clippy::all`
        = help: to override `-W clippy::all` add `#[allow(clippy::precedence)]`

    warning: operator precedence can trip the unwary
       --> src/read.rs:991:28
        |
    991 |                 ptr.write((n >> 6 & 0b0001_1111) as u8 | 0b1100_0000);
        |                            ^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(n >> 6) & 0b0001_1111`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence

    warning: operator precedence can trip the unwary
       --> src/read.rs:995:28
        |
    995 |                 ptr.write((n >> 12 & 0b0000_1111) as u8 | 0b1110_0000);
        |                            ^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(n >> 12) & 0b0000_1111`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence

    warning: operator precedence can trip the unwary
       --> src/read.rs:996:35
        |
    996 |                 ptr.add(1).write((n >> 6 & 0b0011_1111) as u8 | 0b1000_0000);
        |                                   ^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(n >> 6) & 0b0011_1111`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence

    warning: operator precedence can trip the unwary
        --> src/read.rs:1000:28
         |
    1000 |                 ptr.write((n >> 18 & 0b0000_0111) as u8 | 0b1111_0000);
         |                            ^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(n >> 18) & 0b0000_0111`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence

    warning: operator precedence can trip the unwary
        --> src/read.rs:1002:29
         |
    1002 |                     .write((n >> 12 & 0b0011_1111) as u8 | 0b1000_0000);
         |                             ^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(n >> 12) & 0b0011_1111`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence

    warning: operator precedence can trip the unwary
        --> src/read.rs:1003:35
         |
    1003 |                 ptr.add(2).write((n >> 6 & 0b0011_1111) as u8 | 0b1000_0000);
         |                                   ^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(n >> 6) & 0b0011_1111`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
2024-12-26 18:30:54 -08:00
David Tolnay
b2a1415aad
Release 1.0.134 v1.0.134 2024-12-21 10:54:55 -08:00
David Tolnay
9875785f24
Tweak wording of NULL/TRUE/FALSE documentation 2024-12-21 10:51:05 -08:00
David Tolnay
4aa05b9143
Merge pull request #1222 from dtolnay/rawvalueassoc
Move RawValue associated constants into same impl block as public functions
2024-12-11 11:06:54 -08:00
David Tolnay
f42c7c760b
Move RawValue associated constants into same impl block as public functions 2024-12-11 10:58:22 -08:00
David Tolnay
96576bad53
Merge pull request #1221 from bheylin/add-const-raw-values-for-null-and-bools
Add literal 'null', 'true' and 'false' consts to `RawValue` struct.
2024-12-11 10:56:35 -08:00
Brian Heylin
4db66fb0b2 Add 'static lifetime to const's 2024-12-11 10:14:15 +01:00
Brian Heylin
9c9aa1f380 Add literal 'null', 'true' and 'false' consts to RawValue struct. 2024-12-11 09:10:27 +01:00
David Tolnay
0903de449c
Release 1.0.133 v1.0.133 2024-11-16 17:26:01 -08:00
David Tolnay
2b65ca0949
Merge pull request #1215 from dtolnay/fromarray
Implement From<[T; N]> for Value
2024-11-16 17:25:28 -08:00
David Tolnay
4e5f985958
Implement From<[T; N]> for Value 2024-11-16 17:17:56 -08:00
David Tolnay
2ccb5b67ca
Disable question_mark clippy lint in lexical test
Serde_json uses #![deny(clippy::question_mark_used)].

    warning: this `match` expression can be replaced with `?`
      --> tests/../src/lexical/algorithm.rs:54:21
       |
    54 |           let value = match mantissa.checked_mul(power) {
       |  _____________________^
    55 | |             None => return None,
    56 | |             Some(value) => value,
    57 | |         };
       | |_________^ help: try instead: `mantissa.checked_mul(power)?`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
       = note: `-W clippy::question-mark` implied by `-W clippy::all`
       = help: to override `-W clippy::all` add `#[allow(clippy::question_mark)]`
2024-11-15 18:50:53 -08:00
David Tolnay
a11f5f2bc4
Resolve unnecessary_map_or clippy lints
warning: this `map_or` is redundant
     --> src/value/partial_eq.rs:5:5
      |
    5 |     value.as_i64().map_or(false, |i| i == other)
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `(value.as_i64() == Some(other))`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
      = note: `-W clippy::unnecessary-map-or` implied by `-W clippy::all`
      = help: to override `-W clippy::all` add `#[allow(clippy::unnecessary_map_or)]`

    warning: this `map_or` is redundant
     --> src/value/partial_eq.rs:9:5
      |
    9 |     value.as_u64().map_or(false, |i| i == other)
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `(value.as_u64() == Some(other))`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or

    warning: this `map_or` is redundant
      --> src/value/partial_eq.rs:14:29
       |
    14 |         Value::Number(n) => n.as_f32().map_or(false, |i| i == other),
       |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `(n.as_f32() == Some(other))`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or

    warning: this `map_or` is redundant
      --> src/value/partial_eq.rs:20:5
       |
    20 |     value.as_f64().map_or(false, |i| i == other)
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `(value.as_f64() == Some(other))`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or

    warning: this `map_or` is redundant
      --> src/value/partial_eq.rs:24:5
       |
    24 |     value.as_bool().map_or(false, |i| i == other)
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `(value.as_bool() == Some(other))`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or

    warning: this `map_or` is redundant
      --> src/value/partial_eq.rs:28:5
       |
    28 |     value.as_str().map_or(false, |i| i == other)
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a standard comparison instead: `(value.as_str() == Some(other))`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
2024-11-15 18:47:58 -08:00
David Tolnay
07f280a79c
Wrap PR 1213 to 80 columns 2024-11-14 18:44:18 -08:00