David Tolnay
cf3beee3d2
Remove unneeded itoa std feature
...
This feature is not used by serde_json even in std mode.
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
ea39ccb88a
Mirror serde_json features to serde_json_test crate
2020-01-22 12:59:08 -08:00
David Tolnay
83e35ec22a
Tweak feature check message
2020-01-22 12:59:08 -08:00
David Tolnay
91f791bd1c
Merge pull request #606 from Xanewok/no-std-patch
...
Add a no_std/alloc feature
2020-01-22 12:58:53 -08:00
Igor Matuszewski
8e8058a491
Move the core::io implementation to separate module
2020-01-21 21:43:46 +01:00
Igor Matuszewski
3b03040cf0
Make io a subset of std::io
...
So that when implementing a no-`std` logic we don't break the build when
some other dependency opts into `std` (causing API mismatch).
2020-01-21 21:43:46 +01:00
Igor Matuszewski
bac77ed0ff
Imply using alloc crate when std
is not enabled
2020-01-21 21:43:46 +01:00
Igor Matuszewski
7852d2f1e6
Add user-friendly error when no alloc or std feature are enabled
2020-01-21 21:43:46 +01:00
Igor Matuszewski
176ff712f8
Inline the itoa::write calls
...
Inlining this simple, already `core`-compatible function is better than
noisily repeating the same definition that does exactly the same, albeit
hidden behind a fn call.
2020-01-21 21:43:46 +01:00
Igor Matuszewski
d7f7a51c72
travis: Test no_std/alloc on 1.36.0
2020-01-21 21:43:46 +01:00
Igor Matuszewski
b47d2d1aec
Mention availability of alloc feature
2020-01-21 21:43:46 +01:00
Igor Matuszewski
15bfaf6a07
Reorganize std::io facade
2020-01-21 21:43:46 +01:00
Igor Matuszewski
9ecf91504a
Add facade around std/alloc/core like serde does
2020-01-21 21:43:38 +01:00
Tom Dohrmann
65336702c3
Fix std feature dependency for itoa
2020-01-21 15:52:16 +01:00
freax13
4600a9af7f
add alloc/no_std support
2020-01-21 15:52:16 +01:00
David Tolnay
88ee1a69da
Ignore transmute_ptr_to_ptr lint
...
`mem::transmute::<&str, &RawValue>(json)` is more readable and safer
than Clippy's suggestion of `&*(json as *const str as *const RawValue)`.
2020-01-20 21:03:51 -08:00
David Tolnay
57bc9ae77b
Resolve redundant_static_lifetimes lint
...
This has been supported in rustc since 1.17.
https://blog.rust-lang.org/2017/04/27/Rust-1.17.html
2020-01-20 20:43:47 -08:00
David Tolnay
b6119e4c1e
Merge pull request #600 from deankarn/master
...
Add append to Map
2020-01-20 20:28:09 -08:00
David Tolnay
6434761d77
Merge pull request #605 from Xanewok/patch-1
...
Update MSRV to 1.30 in README.md
2020-01-20 14:30:26 -08:00
Igor Matuszewski
bbfdaf04cf
Update MSRV to 1.30 in README.md
...
As it seems to be the case as of latest commit (4b8380261b
)
2020-01-20 20:12:04 +01:00
Dean Karn
5930359ec1
Make compatible with older veersions of rust
...
reworked to use std::mem::replace instead of std::mem::take which was
introduced in v1.40.0 which is just a wrapper for replace.
2020-01-07 09:00:14 -08:00
Dean Karn
a240606c32
Add append to Map
...
This adds append to the Map type. There are two underlying map type ATM:
- BTreeMap
- IndexMap
For BTreeMap this exposes the existing append method which has some nice
perf benefits vs doing a for on the other map and insert on each
element.
For IndexMap there is no existing append method and so as a fallback and
convenience there is a for over the elements and insert simulating an
append.
2020-01-07 08:16:08 -08:00
David Tolnay
4b8380261b
Drop support for rustc <1.30
2019-12-26 21:41:08 -05:00
David Tolnay
a59d451809
Provide source method for Error, to allow downcasting cause
2019-12-26 21:40:43 -05:00
David Tolnay
38a73b32c1
Drop support for rustc <1.27
2019-12-26 21:38:11 -05:00
David Tolnay
1de567b3ff
Remove deprecated description() method from Error
2019-12-26 21:29:41 -05:00
David Tolnay
0f12393325
Opt in to experimental trybuild diffs
2019-12-25 17:41:36 -05:00
David Tolnay
c44a7aa3fb
Remove unneeded lifetimes from pointer signatures
2019-12-18 10:11:49 -08:00
David Tolnay
85dccefa2a
Merge pull request #595 from x3ro/doc/pointer_mut_map_example
...
Add example for how to update value if one exists
2019-12-18 10:07:01 -08:00
Lucas Jenss
7d5115d6c4
Add example for how to update value if one exists
2019-12-18 11:50:04 +01:00
David Tolnay
245afb69a5
Ignore missing_errors_doc pedantic lint
2019-12-15 21:03:32 -08:00
David Tolnay
1977e69349
Release 1.0.44
v1.0.44
2019-12-04 12:27:04 -08:00
David Tolnay
9f13db7b1c
Merge pull request 591 from erickt/value-into-deserializer
2019-12-04 12:25:49 -08:00
Erick Tryzelaar
4ae13a5393
Implement IntoDeserializer for Value
...
This allows users to deserialize from types like `HashMap<String, Value>`.
2019-12-04 10:41:10 -08:00
David Tolnay
f7a4da003c
Release 1.0.43
v1.0.43
2019-12-04 02:41:50 -08:00
David Tolnay
76b23665cc
Merge pull request #590 from nlordell/bump_indexmap_version
...
Fix Required Minimum `indexmap` Version
2019-12-04 02:41:13 -08:00
Nicholas Rodrigues Lordello
19ba7be970
fix required minimum indexmap version
2019-12-04 11:31:54 +01:00
David Tolnay
f0471e6171
Release 1.0.42
v1.0.42
2019-11-24 14:29:20 -08:00
David Tolnay
bf8cc6642f
Merge pull request #585 from Nilix007/add_from_unit_for_value
...
Add `impl From<()> for Value`
2019-11-24 14:27:53 -08:00
Felix Wiedemann
ff5a59ccad
Add impl From<()> for Value
2019-11-19 20:47:14 +01:00
David Tolnay
7dda8235b7
Merge pull request #580 from andrisak/docs_read_without_blocking_eof
...
Fix for Document how to deserialize from a prefix of an io::Read with…
2019-10-31 10:37:27 -07:00
andrisak
2065227366
Added missing fake_main #522
2019-10-31 10:37:11 +01:00