File: bump-ron.diff

package info (click to toggle)
rust-serde-with 3.12.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,740 kB
  • sloc: makefile: 2
file content (238 lines) | stat: -rw-r--r-- 9,460 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
From e741c019921129bc9546fc6edfd1d197b92f5337 Mon Sep 17 00:00:00 2001
From: Jonas Bushart <jonas@bushart.org>
Date: Sun, 4 May 2025 00:47:29 +0200
Subject: [PATCH 2/3] Fix code for ron v0.10
Origin: https://github.com/jonasbb/serde_with/commit/be794b7f89683f1adc9e508f199f0822267f2d47

---
 serde_with/src/lib.rs                 | 6 ++----
 serde_with/src/rust.rs                | 6 ++----
 serde_with/tests/serde_as/enum_map.rs | 2 +-
 3 files changed, 5 insertions(+), 9 deletions(-)

--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1543,15 +1543,14 @@ pub struct TimestampNanoSecondsWithFrac<
 ///     vec: vec![0x41, 0x61, 0x21],
 /// };
 /// let expected = r#"(
-///     array: "MDEyMzQ1Njc4OUFCQ0RF",
-///     boxed: "Li4u",
-///     cow: "Rm9vQmFy",
-///     cow_array: "KioqKioqKioqKioqKioq",
-///     vec: "QWEh",
+///     array: b"0123456789ABCDE",
+///     boxed: b"...",
+///     cow: b"FooBar",
+///     cow_array: b"***************",
+///     vec: b"Aa!",
 /// )"#;
 ///
-/// # let pretty_config = ron::ser::PrettyConfig::new()
-/// #     .new_line("\n".into());
+/// # let pretty_config = ron::ser::PrettyConfig::new().new_line("\n");
 /// assert_eq!(expected, ron::ser::to_string_pretty(&value, pretty_config).unwrap());
 /// assert_eq!(value, ron::from_str(expected).unwrap());
 /// # }
@@ -1582,12 +1581,11 @@ pub struct TimestampNanoSecondsWithFrac<
 ///     buf: &[20u8, 21u8, 22u8],
 /// };
 /// let expected = r#"(
-///     array_buf: "CgoKCgoKCgoKCgoKCgoK",
-///     buf: "FBUW",
+///     array_buf: b"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
+///     buf: b"\x14\x15\x16",
 /// )"#;
 ///
-/// # let pretty_config = ron::ser::PrettyConfig::new()
-/// #     .new_line("\n".into());
+/// # let pretty_config = ron::ser::PrettyConfig::new().new_line("\n");
 /// assert_eq!(expected, ron::ser::to_string_pretty(&value, pretty_config).unwrap());
 /// // RON doesn't support borrowed deserialization of byte arrays
 /// # }
--- a/src/rust.rs
+++ b/src/rust.rs
@@ -115,8 +115,7 @@ pub mod double_option {
 /// }
 ///
 /// // Transparently add/remove Some() wrapper
-/// # let pretty_config = ron::ser::PrettyConfig::new()
-/// #     .new_line("\n".into());
+/// # let pretty_config = ron::ser::PrettyConfig::new().new_line("\n");
 /// let s = r#"(
 ///     mandatory: 1,
 ///     optional: 2,
@@ -130,8 +129,7 @@ pub mod double_option {
 ///
 /// // Missing values are deserialized as `None`
 /// // while `None` values are skipped during serialization.
-/// # let pretty_config = ron::ser::PrettyConfig::new()
-/// #     .new_line("\n".into());
+/// # let pretty_config = ron::ser::PrettyConfig::new().new_line("\n");
 /// let s = r#"(
 ///     mandatory: 1,
 /// )"#;
--- a/tests/serde_as/enum_map.rs
+++ b/tests/serde_as/enum_map.rs
@@ -105,7 +105,7 @@ fn ron_serialize() {
         ],
     };
 
-    let pretty_config = ron::ser::PrettyConfig::new().new_line("\n".into());
+    let pretty_config = ron::ser::PrettyConfig::new().new_line("\n");
     let ron = ron::ser::to_string_pretty(&values, pretty_config).unwrap();
     expect_test::expect![[r#"
             (
@@ -127,78 +127,78 @@ fn ron_serialize() {
     // TODO deserializing a Strings as an Identifier seems unsupported
     let deser_values: ron::Value = ron::de::from_str(&ron).unwrap();
     expect_test::expect![[r#"
+        Map(
             Map(
-                Map(
-                    {
-                        String(
-                            "vec",
-                        ): Map(
-                            Map(
-                                {
-                                    String(
-                                        "Int",
-                                    ): Number(
-                                        Integer(
-                                            456,
-                                        ),
-                                    ),
-                                    String(
-                                        "String",
-                                    ): String(
-                                        "XXX",
-                                    ),
-                                    String(
-                                        "Struct",
-                                    ): Map(
-                                        Map(
-                                            {
-                                                String(
-                                                    "a",
-                                                ): Number(
-                                                    Integer(
-                                                        666,
-                                                    ),
-                                                ),
-                                                String(
-                                                    "b",
-                                                ): String(
-                                                    "BBB",
-                                                ),
-                                                String(
-                                                    "c",
-                                                ): Bool(
-                                                    true,
-                                                ),
-                                            },
-                                        ),
+                {
+                    String(
+                        "vec",
+                    ): Map(
+                        Map(
+                            {
+                                String(
+                                    "Int",
+                                ): Number(
+                                    U16(
+                                        456,
                                     ),
-                                    String(
-                                        "Tuple",
-                                    ): Seq(
-                                        [
-                                            Number(
-                                                Integer(
-                                                    1,
+                                ),
+                                String(
+                                    "String",
+                                ): String(
+                                    "XXX",
+                                ),
+                                String(
+                                    "Struct",
+                                ): Map(
+                                    Map(
+                                        {
+                                            String(
+                                                "a",
+                                            ): Number(
+                                                U16(
+                                                    666,
                                                 ),
                                             ),
                                             String(
-                                                "Middle",
+                                                "b",
+                                            ): String(
+                                                "BBB",
                                             ),
-                                            Bool(
-                                                false,
+                                            String(
+                                                "c",
+                                            ): Bool(
+                                                true,
                                             ),
-                                        ],
+                                        },
                                     ),
-                                    String(
-                                        "Unit",
-                                    ): Unit,
-                                },
-                            ),
+                                ),
+                                String(
+                                    "Tuple",
+                                ): Seq(
+                                    [
+                                        Number(
+                                            U8(
+                                                1,
+                                            ),
+                                        ),
+                                        String(
+                                            "Middle",
+                                        ),
+                                        Bool(
+                                            false,
+                                        ),
+                                    ],
+                                ),
+                                String(
+                                    "Unit",
+                                ): Unit,
+                            },
                         ),
-                    },
-                ),
-            )
-        "#]]
+                    ),
+                },
+            ),
+        )
+    "#]]
     .assert_debug_eq(&deser_values);
 }
 
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -289,7 +289,7 @@ default-features = false
 version = "1.3.0"
 
 [dev-dependencies.ron]
-version = ">=0.7.1, <0.9"
+version = "0.12"
 
 [dev-dependencies.rustversion]
 version = "1.0.0"