Debian Codegraph @

src/de/value.rs

raw symbols SCIP
1 use allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::{borrowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/::ToOwnedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/ToOwned#, boxedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/::Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#, stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/::Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#, vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/::Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#};
2 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/;
3
4 use serderust-analyzer cargo serde 1.0.228 crate/::{
5 derust-analyzer cargo serde_core 1.0.228 de/::{Errorrust-analyzer cargo serde_core 1.0.228 de/Error#, MapAccessrust-analyzer cargo serde_core 1.0.228 de/MapAccess#, SeqAccessrust-analyzer cargo serde_core 1.0.228 de/SeqAccess#, Visitorrust-analyzer cargo serde_core 1.0.228 de/Visitor#},
6 Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#, Deserializerrust-analyzer cargo serde_core 1.0.228 de/Deserializer#,
7 };
8
9 use craterust-analyzer cargo ron 0.12.0 crate/::{
10 errorrust-analyzer cargo ron 0.12.0 error/::SpannedResultrust-analyzer cargo ron 0.12.0 error/SpannedResult#,
11 valuerust-analyzer cargo ron 0.12.0 value/::{Maprust-analyzer cargo ron 0.12.0 value/map/Map#, Numberrust-analyzer cargo ron 0.12.0 value/number/Number#, Valuerust-analyzer cargo ron 0.12.0 value/Value#},
12 };
13
14 impl corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/::FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr# for Valuerust-analyzer cargo ron 0.12.0 value/Value# {
15 type Errrust-analyzer cargo ron 0.12.0 de/value/impl#[Value][FromStr]Err# = craterust-analyzer cargo ron 0.12.0 crate/::errorrust-analyzer cargo ron 0.12.0 error/::SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError#;
16
17 /// Creates a value from a string reference.
18 fn from_strrust-analyzer cargo ron 0.12.0 de/value/impl#[Value][FromStr]from_str().(s: &str) -> SpannedResultrust-analyzer cargo ron 0.12.0 error/SpannedResult#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[Value][FromStr]> {
19 let mut de = superrust-analyzer cargo ron 0.12.0 de/::Deserializerrust-analyzer cargo ron 0.12.0 de/Deserializer#::from_strrust-analyzer cargo ron 0.12.0 de/impl#[`Deserializer<'de>`]from_str().(s)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
20
21 let val = Valuerust-analyzer cargo ron 0.12.0 value/Value#::deserializerust-analyzer cargo ron 0.12.0 de/value/impl#[Value][`Deserialize<'de>`]deserialize().(&mut de).map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|e| de.span_errorrust-analyzer cargo ron 0.12.0 de/impl#[`Deserializer<'de>`]span_error().(e))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
22 de.endrust-analyzer cargo ron 0.12.0 de/impl#[`Deserializer<'de>`]end().().map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|e| de.span_errorrust-analyzer cargo ron 0.12.0 de/impl#[`Deserializer<'de>`]span_error().(e))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
23
24 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(val)
25 }
26 }
27
28 impl<'de> Deserializerust-analyzer cargo serde_core 1.0.228 de/Deserialize#<'de> for Valuerust-analyzer cargo ron 0.12.0 value/Value# {
29 fn deserializerust-analyzer cargo ron 0.12.0 de/value/impl#[Value][`Deserialize<'de>`]deserialize().<D>(deserializer: D) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[Value][`Deserialize<'de>`], D::Errorrust-analyzer cargo serde_core 1.0.228 de/Deserializer#Error#>
30 where
31 D: Deserializerrust-analyzer cargo serde_core 1.0.228 de/Deserializer#<'de>,
32 {
33 deserializer.deserialize_anyrust-analyzer cargo serde_core 1.0.228 de/Deserializer#deserialize_any().(ValueVisitorrust-analyzer cargo ron 0.12.0 de/value/ValueVisitor#)
34 }
35 }
36
37 struct ValueVisitorrust-analyzer cargo ron 0.12.0 de/value/ValueVisitor#;
38
39 impl<'de> Visitorrust-analyzer cargo serde_core 1.0.228 de/Visitor#<'de> for ValueVisitorrust-analyzer cargo ron 0.12.0 de/value/ValueVisitor# {
40 type Valuerust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]Value# = Valuerust-analyzer cargo ron 0.12.0 value/Value#;
41
42 fn expectingrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]expecting().(&self, f: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
43 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "a RON value")
44 }
45
46 fn visit_boolrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_bool().<E>(self, v: bool) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
47 where
48 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
49 {
50 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Boolrust-analyzer cargo ron 0.12.0 value/Value#Bool#(v))
51 }
52
53 fn visit_i8rust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_i8().<E>(self, v: i8) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
54 where
55 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
56 {
57 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(v)))
58 }
59
60 fn visit_i16rust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_i16().<E>(self, v: i16) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
61 where
62 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
63 {
64 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(v)))
65 }
66
67 fn visit_i32rust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_i32().<E>(self, v: i32) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
68 where
69 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
70 {
71 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(v)))
72 }
73
74 fn visit_i64rust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_i64().<E>(self, v: i64) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
75 where
76 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
77 {
78 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(v)))
79 }
80
81 #[cfg(feature = "integer128")]
82 fn visit_i128rust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_i128().<E>(self, v: i128) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
83 where
84 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
85 {
86 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(v)))
87 }
88
89 fn visit_u8rust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_u8().<E>(self, v: u8) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
90 where
91 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
92 {
93 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(v)))
94 }
95
96 fn visit_u16rust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_u16().<E>(self, v: u16) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
97 where
98 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
99 {
100 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(v)))
101 }
102
103 fn visit_u32rust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_u32().<E>(self, v: u32) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
104 where
105 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
106 {
107 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(v)))
108 }
109
110 fn visit_u64rust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_u64().<E>(self, v: u64) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
111 where
112 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
113 {
114 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(v)))
115 }
116
117 #[cfg(feature = "integer128")]
118 fn visit_u128rust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_u128().<E>(self, v: u128) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
119 where
120 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
121 {
122 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(v)))
123 }
124
125 fn visit_f32rust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_f32().<E>(self, v: f32) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
126 where
127 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
128 {
129 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(v)))
130 }
131
132 fn visit_f64rust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_f64().<E>(self, v: f64) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
133 where
134 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
135 {
136 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(v)))
137 }
138
139 fn visit_charrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_char().<E>(self, v: char) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
140 where
141 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
142 {
143 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Charrust-analyzer cargo ron 0.12.0 value/Value#Char#(v))
144 }
145
146 fn visit_strrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_str().<E>(self, v: &str) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
147 where
148 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
149 {
150 self.visit_stringrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_string().(v.to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().())
151 }
152
153 fn visit_stringrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_string().<E>(self, v: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
154 where
155 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
156 {
157 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#(v))
158 }
159
160 fn visit_bytesrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_bytes().<E>(self, v: &[u8]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
161 where
162 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
163 {
164 self.visit_byte_bufrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_byte_buf().(v.to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().())
165 }
166
167 fn visit_byte_bufrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_byte_buf().<E>(self, v: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
168 where
169 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
170 {
171 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Bytesrust-analyzer cargo ron 0.12.0 value/Value#Bytes#(v))
172 }
173
174 fn visit_nonerust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_none().<E>(self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
175 where
176 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
177 {
178 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Optionrust-analyzer cargo ron 0.12.0 value/Value#Option#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#))
179 }
180
181 fn visit_somerust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_some().<D>(self, deserializer: D) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, D::Errorrust-analyzer cargo serde_core 1.0.228 de/Deserializer#Error#>
182 where
183 D: Deserializerrust-analyzer cargo serde_core 1.0.228 de/Deserializer#<'de>,
184 {
185 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Optionrust-analyzer cargo ron 0.12.0 value/Value#Option#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(
186 deserializer.deserialize_anyrust-analyzer cargo serde_core 1.0.228 de/Deserializer#deserialize_any().(ValueVisitorrust-analyzer cargo ron 0.12.0 de/value/ValueVisitor#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().,
187 ))))
188 }
189
190 fn visit_unitrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_unit().<E>(self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, E>
191 where
192 E: Errorrust-analyzer cargo serde_core 1.0.228 de/Error#,
193 {
194 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Unitrust-analyzer cargo ron 0.12.0 value/Value#Unit#)
195 }
196
197 fn visit_newtype_structrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_newtype_struct().<D>(self, deserializer: D) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, D::Errorrust-analyzer cargo serde_core 1.0.228 de/Deserializer#Error#>
198 where
199 D: Deserializerrust-analyzer cargo serde_core 1.0.228 de/Deserializer#<'de>,
200 {
201 deserializer.deserialize_anyrust-analyzer cargo serde_core 1.0.228 de/Deserializer#deserialize_any().(ValueVisitorrust-analyzer cargo ron 0.12.0 de/value/ValueVisitor#)
202 }
203
204 fn visit_seqrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_seq().<A>(self, mut seq: A) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, A::Errorrust-analyzer cargo serde_core 1.0.228 de/SeqAccess#Error#>
205 where
206 A: SeqAccessrust-analyzer cargo serde_core 1.0.228 de/SeqAccess#<'de>,
207 {
208 let mut vec = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().();
209 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(cap) = seq.size_hintrust-analyzer cargo serde_core 1.0.228 de/SeqAccess#size_hint().() {
210 vec.reserve_exactrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]reserve_exact().(cap);
211 }
212
213 while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(x) = seq.next_elementrust-analyzer cargo serde_core 1.0.228 de/SeqAccess#next_element().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). {
214 vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(x);
215 }
216
217 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Seqrust-analyzer cargo ron 0.12.0 value/Value#Seq#(vec))
218 }
219
220 fn visit_maprust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]visit_map().<A>(self, mut map: A) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo ron 0.12.0 de/value/impl#[ValueVisitor][`Visitor<'de>`]::Valuerust-analyzer cargo serde_core 1.0.228 de/Visitor#Value#, A::Errorrust-analyzer cargo serde_core 1.0.228 de/MapAccess#Error#>
221 where
222 A: MapAccessrust-analyzer cargo serde_core 1.0.228 de/MapAccess#<'de>,
223 {
224 let mut res: Maprust-analyzer cargo ron 0.12.0 value/map/Map# = Maprust-analyzer cargo ron 0.12.0 value/map/Map#::newrust-analyzer cargo ron 0.12.0 value/map/impl#[Map]new().();
225
226 #[cfg(feature = "indexmap")]
227 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(cap) = map.size_hintrust-analyzer cargo serde_core 1.0.228 de/MapAccess#size_hint().() {
228 res.0rust-analyzer cargo ron 0.12.0 value/map/Map#0..reserve_exactrust-analyzer cargo indexmap 2.5.0 map/impl#[`IndexMap<K, V, S>`]reserve_exact().(cap);
229 }
230
231 while let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(entry) = map.next_entryrust-analyzer cargo serde_core 1.0.228 de/MapAccess#next_entry().::<Valuerust-analyzer cargo ron 0.12.0 value/Value#, Valuerust-analyzer cargo ron 0.12.0 value/Value#>()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). {
232 res.insertrust-analyzer cargo ron 0.12.0 value/map/impl#[Map]insert().(entry.0, entry.1);
233 }
234
235 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Maprust-analyzer cargo ron 0.12.0 value/Value#Map#(res))
236 }
237 }
238
239 #[cfg(test)]
240 mod testsrust-analyzer cargo ron 0.12.0 de/value/tests/ {
241 use allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/;
242 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/::FromStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/traits/FromStr#;
243
244 use superrust-analyzer cargo ron 0.12.0 de/value/::*;
245
246 fn evalrust-analyzer cargo ron 0.12.0 de/value/tests/eval().(s: &str) -> Valuerust-analyzer cargo ron 0.12.0 value/Value# {
247 s.parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().().expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Failed to parse")
248 }
249
250 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
251 fn test_nonerust-analyzer cargo ron 0.12.0 de/value/tests/test_none().() {
252 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(evalrust-analyzer cargo ron 0.12.0 de/value/tests/eval().("None"), Valuerust-analyzer cargo ron 0.12.0 value/Value#::Optionrust-analyzer cargo ron 0.12.0 value/Value#Option#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#));
253 }
254
255 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
256 fn test_somerust-analyzer cargo ron 0.12.0 de/value/tests/test_some().() {
257 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(evalrust-analyzer cargo ron 0.12.0 de/value/tests/eval().("Some(())"), Valuerust-analyzer cargo ron 0.12.0 value/Value#::Optionrust-analyzer cargo ron 0.12.0 value/Value#Option#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Unitrust-analyzer cargo ron 0.12.0 value/Value#Unit#))));
258 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
259 evalrust-analyzer cargo ron 0.12.0 de/value/tests/eval().("Some ( () )"),
260 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Optionrust-analyzer cargo ron 0.12.0 value/Value#Option#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Unitrust-analyzer cargo ron 0.12.0 value/Value#Unit#)))
261 );
262 }
263
264 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
265 fn test_tuples_basicrust-analyzer cargo ron 0.12.0 de/value/tests/test_tuples_basic().() {
266 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
267 evalrust-analyzer cargo ron 0.12.0 de/value/tests/eval().("(3, 4.0, 5.0)"),
268 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Seqrust-analyzer cargo ron 0.12.0 value/Value#Seq#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![
269 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::U8rust-analyzer cargo ron 0.12.0 value/number/Number#U8#(3)),
270 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::F32rust-analyzer cargo ron 0.12.0 value/number/Number#F32#(4.0.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())),
271 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::F32rust-analyzer cargo ron 0.12.0 value/number/Number#F32#(5.0.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())),
272 ],),
273 );
274 }
275
276 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
277 fn test_tuples_identrust-analyzer cargo ron 0.12.0 de/value/tests/test_tuples_ident().() {
278 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
279 evalrust-analyzer cargo ron 0.12.0 de/value/tests/eval().("(true, 3, 4, 5.0)"),
280 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Seqrust-analyzer cargo ron 0.12.0 value/Value#Seq#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![
281 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Boolrust-analyzer cargo ron 0.12.0 value/Value#Bool#(true),
282 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::U8rust-analyzer cargo ron 0.12.0 value/number/Number#U8#(3)),
283 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::U8rust-analyzer cargo ron 0.12.0 value/number/Number#U8#(4)),
284 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::F32rust-analyzer cargo ron 0.12.0 value/number/Number#F32#(5.0.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())),
285 ]),
286 );
287 }
288
289 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
290 fn test_tuples_errorrust-analyzer cargo ron 0.12.0 de/value/tests/test_tuples_error().() {
291 use craterust-analyzer cargo ron 0.12.0 crate/::derust-analyzer cargo ron 0.12.0 de/::{Errorrust-analyzer cargo ron 0.12.0 error/Error#, Positionrust-analyzer cargo ron 0.12.0 error/Position#, Spanrust-analyzer cargo ron 0.12.0 error/Span#, SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError#};
292
293 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
294 Valuerust-analyzer cargo ron 0.12.0 value/Value#::from_strrust-analyzer cargo ron 0.12.0 de/value/impl#[Value][FromStr]from_str().("Foo:").unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().(),
295 SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
296 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: Errorrust-analyzer cargo ron 0.12.0 error/Error#::TrailingCharactersrust-analyzer cargo ron 0.12.0 error/Error#TrailingCharacters#,
297 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: Spanrust-analyzer cargo ron 0.12.0 error/Span# {
298 startrust-analyzer cargo ron 0.12.0 error/Span#start.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 4 },
299 endrust-analyzer cargo ron 0.12.0 error/Span#end.: Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 4 }
300 }
301 },
302 );
303 }
304
305 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
306 fn test_floatsrust-analyzer cargo ron 0.12.0 de/value/tests/test_floats().() {
307 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
308 evalrust-analyzer cargo ron 0.12.0 de/value/tests/eval().("(inf, -inf, NaN)"),
309 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Seqrust-analyzer cargo ron 0.12.0 value/Value#Seq#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![
310 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::INFINITYrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/INFINITY.)),
311 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::NEG_INFINITYrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/NEG_INFINITY.)),
312 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::newrust-analyzer cargo ron 0.12.0 value/number/impl#[Number]new().(corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::f32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/::NANrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/NAN.)),
313 ]),
314 );
315 }
316
317 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
318 fn test_complexrust-analyzer cargo ron 0.12.0 de/value/tests/test_complex().() {
319 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
320 evalrust-analyzer cargo ron 0.12.0 de/value/tests/eval().(
321 "Some([
322 Room ( width: 20, height: 5, name: \"The Room\" ),
323
324 (
325 width: 10.0,
326 height: 10.0,
327 name: \"Another room\",
328 enemy_levels: {
329 \"Enemy1\": 3,
330 \"Enemy2\": 5,
331 \"Enemy3\": 7,
332 },
333 ),
334 ])"
335 ),
336 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Optionrust-analyzer cargo ron 0.12.0 value/Value#Option#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(Valuerust-analyzer cargo ron 0.12.0 value/Value#::Seqrust-analyzer cargo ron 0.12.0 value/Value#Seq#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![
337 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Maprust-analyzer cargo ron 0.12.0 value/Value#Map#(
338 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![
339 (
340 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#("width".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()),
341 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::U8rust-analyzer cargo ron 0.12.0 value/number/Number#U8#(20)),
342 ),
343 (
344 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#("height".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()),
345 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::U8rust-analyzer cargo ron 0.12.0 value/number/Number#U8#(5)),
346 ),
347 (
348 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#("name".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()),
349 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#("The Room".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()),
350 ),
351 ]
352 .into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().()
353 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().(),
354 ),
355 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Maprust-analyzer cargo ron 0.12.0 value/Value#Map#(
356 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![
357 (
358 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#("width".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()),
359 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::F32rust-analyzer cargo ron 0.12.0 value/number/Number#F32#(10.0.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())),
360 ),
361 (
362 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#("height".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()),
363 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::F32rust-analyzer cargo ron 0.12.0 value/number/Number#F32#(10.0.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())),
364 ),
365 (
366 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#("name".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()),
367 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#("Another room".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()),
368 ),
369 (
370 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#("enemy_levels".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()),
371 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Maprust-analyzer cargo ron 0.12.0 value/Value#Map#(
372 vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![
373 (
374 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#("Enemy1".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()),
375 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::U8rust-analyzer cargo ron 0.12.0 value/number/Number#U8#(3)),
376 ),
377 (
378 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#("Enemy2".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()),
379 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::U8rust-analyzer cargo ron 0.12.0 value/number/Number#U8#(5)),
380 ),
381 (
382 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#("Enemy3".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()),
383 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::U8rust-analyzer cargo ron 0.12.0 value/number/Number#U8#(7)),
384 ),
385 ]
386 .into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().()
387 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().(),
388 ),
389 ),
390 ]
391 .into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().()
392 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().(),
393 ),
394 ]))))
395 );
396 }
397
398 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
399 fn test_structrust-analyzer cargo ron 0.12.0 de/value/tests/test_struct().() {
400 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
401 evalrust-analyzer cargo ron 0.12.0 de/value/tests/eval().("(a:42)"),
402 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Maprust-analyzer cargo ron 0.12.0 value/Value#Map#(
403 [(
404 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("a")),
405 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::U8rust-analyzer cargo ron 0.12.0 value/number/Number#U8#(42))
406 )]
407 .into_iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/iter/impl#[`[T; N]`][IntoIterator]into_iter().()
408 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().()
409 ),
410 );
411 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
412 evalrust-analyzer cargo ron 0.12.0 de/value/tests/eval().("(r#a:42)"),
413 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Maprust-analyzer cargo ron 0.12.0 value/Value#Map#(
414 [(
415 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Stringrust-analyzer cargo ron 0.12.0 value/Value#String#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("a")),
416 Valuerust-analyzer cargo ron 0.12.0 value/Value#::Numberrust-analyzer cargo ron 0.12.0 value/Value#Number#(Numberrust-analyzer cargo ron 0.12.0 value/number/Number#::U8rust-analyzer cargo ron 0.12.0 value/number/Number#U8#(42))
417 )]
418 .into_iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/iter/impl#[`[T; N]`][IntoIterator]into_iter().()
419 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().()
420 ),
421 );
422 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
423 "(r#:42)".parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().::<Valuerust-analyzer cargo ron 0.12.0 value/Value#>().unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().(),
424 craterust-analyzer cargo ron 0.12.0 crate/::errorrust-analyzer cargo ron 0.12.0 error/::SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
425 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: craterust-analyzer cargo ron 0.12.0 crate/::Errorrust-analyzer cargo ron 0.12.0 error/Error#::ExpectedStringrust-analyzer cargo ron 0.12.0 error/Error#ExpectedString#,
426 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: craterust-analyzer cargo ron 0.12.0 crate/::errorrust-analyzer cargo ron 0.12.0 error/::Spanrust-analyzer cargo ron 0.12.0 error/Span# {
427 startrust-analyzer cargo ron 0.12.0 error/Span#start.: craterust-analyzer cargo ron 0.12.0 crate/::errorrust-analyzer cargo ron 0.12.0 error/::Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 3 },
428 endrust-analyzer cargo ron 0.12.0 error/Span#end.: craterust-analyzer cargo ron 0.12.0 crate/::errorrust-analyzer cargo ron 0.12.0 error/::Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 4 },
429 }
430 },
431 );
432
433 // Check for a failure in Deserializer::check_struct_type
434 // - opening brace triggers the struct type check
435 // - unclosed block comment fails the whitespace skip
436 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
437 "( /*".parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().::<Valuerust-analyzer cargo ron 0.12.0 value/Value#>().unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().(),
438 craterust-analyzer cargo ron 0.12.0 crate/::errorrust-analyzer cargo ron 0.12.0 error/::SpannedErrorrust-analyzer cargo ron 0.12.0 error/SpannedError# {
439 coderust-analyzer cargo ron 0.12.0 error/SpannedError#code.: craterust-analyzer cargo ron 0.12.0 crate/::Errorrust-analyzer cargo ron 0.12.0 error/Error#::UnclosedBlockCommentrust-analyzer cargo ron 0.12.0 error/Error#UnclosedBlockComment#,
440 spanrust-analyzer cargo ron 0.12.0 error/SpannedError#span.: craterust-analyzer cargo ron 0.12.0 crate/::errorrust-analyzer cargo ron 0.12.0 error/::Spanrust-analyzer cargo ron 0.12.0 error/Span# {
441 startrust-analyzer cargo ron 0.12.0 error/Span#start.: craterust-analyzer cargo ron 0.12.0 crate/::errorrust-analyzer cargo ron 0.12.0 error/::Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 3 },
442 endrust-analyzer cargo ron 0.12.0 error/Span#end.: craterust-analyzer cargo ron 0.12.0 crate/::errorrust-analyzer cargo ron 0.12.0 error/::Positionrust-analyzer cargo ron 0.12.0 error/Position# { linerust-analyzer cargo ron 0.12.0 error/Position#line.: 1, colrust-analyzer cargo ron 0.12.0 error/Position#col.: 5 },
443 }
444 },
445 );
446 }
447 }