Fix unwrap being hit in macro when malicious input is given

This commit is contained in:
Ephraim Kunz
2022-01-08 07:52:13 -08:00
parent 19b51168c9
commit c4d4828c56
2 changed files with 28 additions and 1 deletions

View File

@@ -116,7 +116,7 @@ pub fn parse(
self,
v: &str,
) -> ::std::result::Result<Self::Value, ::std::string::String> {
::std::result::Result::Ok(#field_type::from_str(#map_if_bool).unwrap())
#field_type::from_str(#map_if_bool).map_err(|e| e.to_string())
}
}
})