David Tolnay
ac4001e590
Remove some unused trait impls from private UnitOnly variant accessor
2021-01-23 23:07:13 -08:00
David Tolnay
fbcb2230bb
Make use of fmt::Result type alias from libcore
2021-01-23 22:57:13 -08:00
David Tolnay
86c88bea12
Hide some irrelevant detail from de::value::Error's Debug impl
2021-01-23 22:49:00 -08:00
David Tolnay
82d0fe00fd
Add link to rust-lang/rust#67295
2021-01-23 22:32:30 -08:00
David Tolnay
e61261e002
Move doctest-only helpers to a doc module
2021-01-23 22:32:30 -08:00
David Tolnay
9fd56cd41c
Remove unused __private_deserialize macro, originally for doctests
2021-01-23 22:26:16 -08:00
Taiki Endo
e81f54fbc8
Make AST borrow checker happy
2021-01-24 15:23:54 +09:00
Taiki Endo
c67017d466
Fix handling of Self keyword in type definition
2021-01-24 15:23:51 +09:00
David Tolnay
f6e7366b46
Remove unused Debug impl on private::ser::content::Content
2021-01-23 22:10:48 -08:00
David Tolnay
1f9f72bc48
Merge pull request 1898 from Mingun/bytes-into-deserializer
2021-01-23 22:04:20 -08:00
David Tolnay
e24dbc418d
Skip another clone of the fallthrough arm
2021-01-23 20:52:03 -08:00
David Tolnay
18e5b03fd1
Merge pull request #1962 from serde-rs/dupborrowed
...
Eliminate duplicated borrowed and non-borrowed identifier deserialization
2021-01-23 20:51:56 -08:00
David Tolnay
5aa163f27e
Revert "Regenerate macrotest outputs for PR #1917 "
...
This reverts commit 999b94d6ae
.
2021-01-23 20:36:26 -08:00
David Tolnay
3728d3c67a
Eliminate duplicated borrowed and non-borrowed identifier deserialization
2021-01-23 20:32:38 -08:00
David Tolnay
3f48ed36cc
Restore compatibility with rustc <1.31 in Borrowed identifier deserializer
...
The implied lifetime bound on T only works on 1.31+. Older versions fail
with:
error[E0309]: the parameter type `T` may not live long enough
--> serde/src/private/de.rs:2548:37
|
2548 | pub struct Borrowed<'de, T: ?Sized>(pub &'de T);
| -- ^^^^^^^^^^
| |
| help: consider adding an explicit lifetime bound `T: 'de`...
|
note: ...so that the reference type `&'de T` does not outlive the data it points at
--> serde/src/private/de.rs:2548:37
|
2548 | pub struct Borrowed<'de, T: ?Sized>(pub &'de T);
| ^^^^^^^^^^
2021-01-23 20:19:33 -08:00
David Tolnay
b6a2d07f26
Return IdentifierDeserializer to just one associated type
...
The BorrowedDeserializer was added in #1917 , but only makes sense for
&str and &[u8], not for u64 which also needs to be have an
IdentifierDeserializer impl.
2021-01-23 20:04:58 -08:00
David Tolnay
84ad76b2e5
Ignore too_many_lines clippy pedantic lint in serde_test
...
error: this function has too many lines (107/100)
--> serde_test/src/de.rs:128:5
|
128 | / fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error>
129 | | where
130 | | V: Visitor<'de>,
131 | | {
... |
238 | | }
239 | | }
| |_____^
|
note: the lint level is defined here
--> serde_test/src/lib.rs:149:52
|
149 | #![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
| ^^^^^^^^^^^^^^^
= note: `#[deny(clippy::too_many_lines)]` implied by `#[deny(clippy::pedantic)]`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
2021-01-23 20:04:30 -08:00
David Tolnay
e6b6602a42
Merge pull request 1914 from Mingun/seq-other
2021-01-23 19:50:39 -08:00
David Tolnay
999b94d6ae
Regenerate macrotest outputs for PR #1917
2021-01-23 19:43:02 -08:00
David Tolnay
fa6712d2bf
Merge pull request #1918 from Mingun/fix-serde-test
...
Fix incorrect message in serializer tokens and correctly implement next_entry_seed
2021-01-23 15:02:32 -08:00
David Tolnay
012ea8eb84
Keep conditional compilation cfg naming consistent with serde crate
...
The serde crate's build.rs uses names like `core_duration` or
`integer128`, not `has_core_duration` / `has_integer128`.
2021-01-23 14:57:12 -08:00
David Tolnay
9add5812e2
Update track_caller cfg link to show what version it's in
2021-01-23 14:56:03 -08:00
David Tolnay
5fd52100b6
Merge pull request #1920 from Mingun/track_caller
...
Show correct location in error messages by tracking caller of utility `assert_tokens` functions
2021-01-23 14:54:24 -08:00
David Tolnay
6670a309ca
Merge pull request #1961 from serde-rs/renamerule
...
Provide list of recognized rename rules on parse error
2021-01-23 14:50:02 -08:00
David Tolnay
b7bad3a165
Restore compatibility with rustc 1.31 in RenameRule error
...
str::escape_debug wasn't stabilized until 1.34, whereas serde_derive
currently supports an oldest version of 1.31.
2021-01-23 14:40:44 -08:00
David Tolnay
4e002ece07
Provide list of recognized rename rules on parse error
2021-01-23 14:38:20 -08:00
David Tolnay
eaccae2c46
Fix UPPERCASE rename rule variant to follow idiomatic variant naming
...
This shouldn't have been named this way in PR #1132 .
2021-01-23 14:27:33 -08:00
David Tolnay
990a502c39
Parse rename rules based on table of rules
...
This will make it possible to reuse the same table of recognized rules
in the parse error message.
2021-01-23 14:24:21 -08:00
David Tolnay
661206d885
Merge pull request #1960 from serde-rs/renamerule
...
Deduplicate RenameRule parse error message generation
2021-01-23 14:23:09 -08:00
David Tolnay
51d4563ed1
Move RenameRule parse error message to a Display impl
2021-01-23 14:13:47 -08:00
David Tolnay
7db0982e58
Add error type to use for RenameRule parsing
2021-01-23 14:09:58 -08:00
David Tolnay
ed04824f10
Move RenameRule parse from trait fn to associated
...
This will allow updating it to return an Err that borrows the input
string, which is not possible with FromStr.
2021-01-23 14:07:59 -08:00
David Tolnay
88ee470a1c
Format PR #1916 with rustfmt 1.4.32
2021-01-23 13:39:12 -08:00
David Tolnay
a5ecbdb4f4
Merge pull request 1916 from Mingun/expecting-customize
2021-01-23 13:38:45 -08:00
David Tolnay
bd588db067
Release 1.0.121
2021-01-23 13:17:08 -08:00
David Tolnay
8f09aeacdd
Merge pull request #1959 from serde-rs/1917
...
Touch up borrowed field identifiers PR
2021-01-23 13:15:30 -08:00
David Tolnay
0b5c56b0db
Touch up documentation from PR #1917
2021-01-23 13:09:37 -08:00
David Tolnay
85de92e6f7
Inline forward_deserializer for bytes deserializers
2021-01-23 13:08:08 -08:00
David Tolnay
c858a1fa77
Clean up unnecessary macro_use from PR #1917
2021-01-23 12:59:12 -08:00
David Tolnay
d02eb22557
Inline some unnecessary constructor functions from PR #1917
2021-01-23 12:58:42 -08:00
David Tolnay
034fe25d5b
Remove redundant unused trait impls from private types from PR #1917
2021-01-23 12:58:42 -08:00
David Tolnay
0a230e8598
Inline forward_deserializer into private::de for Str deserializers
...
We shouldn't try to use the same macro for public and private types. The
API for a private type can usually be pared much further down to save
compile time, such as Debug and Copy and Clone impls.
2021-01-23 12:57:35 -08:00
David Tolnay
b20214d4a0
Undo macro exports from PR #1917
...
All of these macros are only used internally within the serde crate.
There is no need for them to have #[macro_export] and need to be hidden
from docs.
2021-01-23 12:40:01 -08:00
David Tolnay
34f4b68f77
Fix unneeded clone from PR #1917
2021-01-23 12:40:00 -08:00
David Tolnay
60e08f9545
Format PR #1917 with rustfmt 1.4.32
2021-01-23 12:39:59 -08:00
David Tolnay
ba46f45dc5
Merge pull request 1917 from Mingun/borrow-identifier
2021-01-23 12:39:28 -08:00
David Tolnay
44b9567e21
Merge pull request #1958 from jonasbb/duration-panic
...
Prevent panic when deserializing malformed Duration
2021-01-23 00:45:39 -08:00
Jonas Bushart
b276849ce1
Prevent panic when deserializing malformed Duration
...
std::time::Duration::new can panic. There is no alternative non-panicing constructor.
Check the panic condition beforehand and return an error instead of panicing.
Fixes #1933
2021-01-20 20:41:45 +01:00
David Tolnay
398fba9b1e
Release 1.0.120
2021-01-18 22:55:13 -08:00
David Tolnay
cd6697b0e4
Merge pull request #1955 from TheJokr/patch-1
...
Add 128-bit integer support to de::IgnoredAny
2021-01-18 22:54:43 -08:00