File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -263,12 +263,34 @@ impl std::fmt::Display for MapType {
263263 }
264264}
265265
266+ impl < ' de > serde:: Deserialize < ' de > for MapType {
267+ fn deserialize < D > ( deserializer : D ) -> std:: result:: Result < Self , D :: Error >
268+ where
269+ D : serde:: Deserializer < ' de > ,
270+ {
271+ let s = <& str >:: deserialize ( deserializer) ?;
272+ Ok ( Self :: new ( s) )
273+ }
274+ }
275+
276+ impl From < String > for MapType {
277+ fn from ( s : String ) -> Self {
278+ Self :: new ( & s)
279+ }
280+ }
281+
266282impl From < & str > for MapType {
267283 fn from ( s : & str ) -> Self {
268284 Self :: new ( s)
269285 }
270286}
271287
288+ impl From < syn:: Type > for MapType {
289+ fn from ( t : syn:: Type ) -> Self {
290+ Self ( t)
291+ }
292+ }
293+
272294/// Settings that alter type generation.
273295#[ derive( Default , Debug , Clone ) ]
274296pub struct TypeSpaceSettings {
You can’t perform that action at this time.
0 commit comments