martin-g edited a comment on pull request #1368:
URL: https://github.com/apache/avro/pull/1368#issuecomment-943248698


   I came up with the following test:
   
   ```rust
       #[test]
       fn test_from_value_map() -> TestResult<()> {
           #[derive(Debug, Deserialize, PartialEq)]
           struct StructWithMap {
               map: HashMap<String, i64>,
           }
           let raw_map: HashMap<String, i64> = [
               ("one".to_string(), 1i64),
               ("three".to_string(), 3i64),
               ("two".to_string(), 2i64)
           ].iter().cloned().collect();
   
           let map = raw_map.iter()
               .map(|(k, v)| (k.clone(), Value::Long(*v)))
               .collect();
           let value = Value::Record(vec![
               ("map".to_string(), Value::Map(map)),
           ]);
           let result = crate::from_value::<StructWithMap>(&value)?;
           assert_eq!(result, StructWithMap{ map: raw_map });
           Ok(())
       }
   ```
   
   but it still passes even without your changes related to Value::Map.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to