5
5
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
6
*/
7
7
8
- // TODO remove this warning once impl is complete
9
- // Several types have #[allow(dead_code)], can be subsequently removed.
10
-
11
- // In #[derive(DeJson)].
8
+ // In #[derive(DeJson)]: "this block may be rewritten with the `?` operator"
12
9
#![ allow( clippy:: question_mark) ]
13
- //
10
+
14
11
// This file acts as deserialization check of the JSON file. Even if some fields are unused, having them declared makes sure they're
15
12
// deserializable and conform to our expectations. It also doesn't add much value to annotate individual fields; it doesn't really
16
13
// matter if some are unused because it's external input data.
17
- #![ allow( dead_code) ]
18
14
19
15
use nanoserde:: DeJson ;
20
16
@@ -38,7 +34,9 @@ pub struct JsonHeader {
38
34
pub version_major : u8 ,
39
35
pub version_minor : u8 ,
40
36
pub version_patch : u8 ,
37
+ #[ allow( dead_code) ]
41
38
pub version_status : String ,
39
+ #[ allow( dead_code) ]
42
40
pub version_build : String ,
43
41
pub version_full_name : String ,
44
42
}
@@ -58,7 +56,9 @@ pub struct JsonBuiltinSizeForConfig {
58
56
#[ derive( DeJson ) ]
59
57
pub struct JsonBuiltinClass {
60
58
pub name : String ,
59
+ #[ allow( dead_code) ]
61
60
pub indexing_return_type : Option < String > ,
61
+ #[ allow( dead_code) ]
62
62
pub is_keyed : bool ,
63
63
// pub members: Option<Vec<Member>>,
64
64
// pub constants: Option<Vec<BuiltinConstant>>,
@@ -156,11 +156,14 @@ pub struct JsonBuiltinConstant {
156
156
#[ derive( DeJson ) ]
157
157
pub struct JsonOperator {
158
158
pub name : String ,
159
+ #[ allow( dead_code) ]
159
160
pub right_type : Option < String > , // null if unary
161
+ #[ allow( dead_code) ]
160
162
pub return_type : String ,
161
163
}
162
164
163
165
#[ derive( DeJson ) ]
166
+ #[ allow( dead_code) ]
164
167
pub struct JsonMember {
165
168
pub name : String ,
166
169
#[ nserde( rename = "type" ) ]
@@ -194,7 +197,8 @@ pub struct JsonConstructor {
194
197
pub struct JsonUtilityFunction {
195
198
pub name : String ,
196
199
pub return_type : Option < String > ,
197
- /// `"general"` or `"math"`
200
+ /// Category: `"general"` or `"math"`
201
+ #[ allow( dead_code) ]
198
202
pub category : String ,
199
203
pub is_vararg : bool ,
200
204
pub hash : i64 ,
0 commit comments