314 Commits

Author SHA1 Message Date
David Tolnay
fd6741f4b0
Release 1.0.50 2020-03-28 11:31:26 -07:00
David Tolnay
4ac9f6c7bf
Merge pull request #640 from smarnach/smarnach/eq-impls
Implement Eq for Map, Number and Value.
2020-03-28 11:23:11 -07:00
Sven Marnach
99eb4eab76
Implement Eq for Map, Number and Value.
These types already have `PartialEq` implementations which define equivalence
relations, so we can implement `Eq` as well. Fixes #638.
2020-03-28 10:31:59 +01:00
David Tolnay
50656bd7de
Release 1.0.49 2020-03-27 23:19:22 -07:00
David Tolnay
8afacb9051
Improve error message when neither std nor alloc is enabled 2020-03-27 23:01:37 -07:00
David Tolnay
da0a39fff7
Provide optimized collect_str methods for Value serializer 2020-03-27 23:00:55 -07:00
David Tolnay
f59b637295
Don't reallocate the string in serialize_char 2020-03-27 22:59:31 -07:00
David Tolnay
8db39542bb
Move ?Sized bounds out of generic parameter lists 2020-03-27 22:30:53 -07:00
David Tolnay
290768cf35
Implement collect_str for map keys 2020-03-27 22:13:11 -07:00
David Tolnay
7c130827eb
Standardize on using Result type alias where possible 2020-03-27 22:10:52 -07:00
David Tolnay
2da5e20682
Format with rustfmt 2020-03-11 2020-03-27 22:07:12 -07:00
David Tolnay
1583c169e2
Simplify Map's PartialEq impl 2020-03-27 09:25:08 -07:00
David Tolnay
f4c8c5188a
Suppress wildcard import pedantic lints 2020-02-25 18:36:25 -08:00
David Tolnay
56c569b0f8
Suppress buggy excessive_precision lint
https://github.com/rust-lang/rust-clippy/issues/5201
2020-02-19 20:43:54 -08:00
David Tolnay
ed479b4656
Release 1.0.48 2020-02-12 21:39:13 -08:00
David Tolnay
ae4bbff11f
Show implementation of to_value in value::Serializer docs 2020-02-12 21:38:48 -08:00
David Tolnay
03e27f5eb7
Extend documentation of value::Serializer 2020-02-12 21:38:48 -08:00
Sean Leffler
9851d44dcc expose value serializer 2020-02-12 18:48:10 -08:00
David Tolnay
5efd1f4f1b
Ignore match_single_binding clippy lint 2020-02-12 18:19:23 -08:00
David Tolnay
6b5ded97b4
Release 1.0.47 2020-02-07 11:42:29 -08:00
David Tolnay
39ed887748
Release 1.0.46 2020-02-02 12:41:03 -08:00
David Tolnay
5263b6f0ed
Fixup serialize_entry PR 2020-02-02 12:39:45 -08:00
Jean-Marc Fiaschi
0b43936690 remplace serialize key,value functions by serialize_entry
call serialize_key/value into serialize_entry
2020-02-02 17:25:24 +01:00
David Tolnay
a39bcade70
Release 1.0.45 2020-01-22 16:02:36 -08:00
David Tolnay
af4e6a1e91
Copy no-std note to rustdoc 2020-01-22 16:01:36 -08:00
David Tolnay
4bcc3625c3
Adopt dyn syntax for trait objects 2020-01-22 14:07:17 -08:00
David Tolnay
50faa3c000
Adopt inclusive range syntax 2020-01-22 14:06:03 -08:00
David Tolnay
17824dc1ea
Remove error variants that are never constructed 2020-01-22 14:04:18 -08:00
David Tolnay
7cf0156d47
Switch to tool attrs 2020-01-22 14:03:12 -08:00
David Tolnay
97f87f2587
Adopt pub(crate) 2020-01-22 13:59:08 -08:00
David Tolnay
17d9a5ea9b
Organize imports 2020-01-22 13:53:35 -08:00
David Tolnay
d095bab515
Remove ```edition2018 from doc tests after edition update 2020-01-22 13:42:51 -08:00
David Tolnay
70b64fd657
Update to 2018 edition 2020-01-22 13:41:21 -08:00
David Tolnay
873a7e9574
Rename try! macro to avoid 2018 edition keyword 2020-01-22 13:34:37 -08:00
David Tolnay
ab4ca99fcb
Omit to_writer and Serializer in no_std mode
These rely on the caller to pass in a Write impl; the impls provided in
serde_json are only for Vec<u8> and I don't want to be in the business
of copying many more Write impls from std into serde_json.
2020-01-22 12:59:10 -08:00
David Tolnay
0de7b516f5
Remove Read and Bytes
These are unused in no-std mode; the Read trait had no implementations.
2020-01-22 12:59:10 -08:00
David Tolnay
1f616f081a
Omit from_reader in no_std mode 2020-01-22 12:59:10 -08:00
David Tolnay
7b0b96e6ab
Remove more of core io error 2020-01-22 12:59:09 -08:00
David Tolnay
7f41cbe201
Remove unneeded Debug impl on io error
Io errors can never occur in no_std mode.
2020-01-22 12:59:09 -08:00
David Tolnay
7051b992e0
Remove WriteZero error kind 2020-01-22 12:59:09 -08:00
David Tolnay
def04dedc1
Remove source method in no_std mode
An io error can never occur in no_std mode so the source method is never
applicable.
2020-01-22 12:59:09 -08:00
David Tolnay
67857df516
Remove unnecessary box trait object from io error repr 2020-01-22 12:59:09 -08:00
David Tolnay
e83673adea
Remove unnecessary From<Error> for io::Error in no_std mode 2020-01-22 12:59:09 -08:00
David Tolnay
85008aa29c
Preserve underlying Debug representation for io error 2020-01-22 12:59:09 -08:00
David Tolnay
ab661bb29c
Remove unused ErrorKind from io error repr 2020-01-22 12:59:08 -08:00
David Tolnay
5741cfb44a
Remove unused Simple io error variant 2020-01-22 12:59:08 -08:00
David Tolnay
f063631c0a
Remove reliance on serde StdError for io error repr
There is no impl Into<Box<dyn serde:🇩🇪:StdError + Send + Sync>> for
&str in no_std mode, which was expected by code elsewhere in the crate.

    error[E0277]: the trait bound `alloc::boxed::Box<(dyn serde:🇩🇪:StdError + core::marker::Send + core::marker::Sync + 'static)>: core::convert::From<&str>` is not satisfied
       --> src/value/mod.rs:199:13
        |
    199 |             io::Error::new(io::ErrorKind::Other, "fmt error")
        |             ^^^^^^^^^^^^^^ the trait `core::convert::From<&str>` is not implemented for `alloc::boxed::Box<(dyn serde:🇩🇪:StdError + core::marker::Send + core::marker::Sync + 'static)>`
        |
       ::: src/io/core.rs:62:12
        |
    62  |     pub fn new<E>(kind: ErrorKind, error: E) -> Error
        |            ---
    63  |     where
    64  |         E: Into<Box<dyn serde:🇩🇪:StdError + Send + Sync>>,
        |            ------------------------------------------------ required by this bound in `io:👿:Error::new`
        |
        = help: the following implementations were found:
                  <alloc::boxed::Box<T> as core::convert::From<T>>
                  <alloc::boxed::Box<[T]> as core::convert::From<&[T]>>
                  <alloc::boxed::Box<[T]> as core::convert::From<serde::export::Vec<T>>>
                  <alloc::boxed::Box<[u8]> as core::convert::From<alloc::boxed::Box<str>>>
                and 2 others
        = note: required because of the requirements on the impl of `core::convert::Into<alloc::boxed::Box<(dyn serde:🇩🇪:StdError + core::marker::Send + core::marker::Sync + 'static)>>` for `&str`
2020-01-22 12:59:08 -08:00
David Tolnay
541d8a1de7
De Morgan the features check 2020-01-22 12:59:08 -08:00
David Tolnay
d57dffb3e8
Remove a layer of reexports from io facade 2020-01-22 12:59:08 -08:00
David Tolnay
83e35ec22a
Tweak feature check message 2020-01-22 12:59:08 -08:00