Skip to content

Commit

Permalink
correct panic string
Browse files Browse the repository at this point in the history
  • Loading branch information
Batch21 committed Jan 20, 2025
1 parent cfbfba5 commit 6999a10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pywr-schema/src/parameters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,15 +716,15 @@ mod tests {
serde_json::from_str(&data).unwrap_or_else(|_| panic!("Failed to deserialize: {:?}", p));

match value {
serde_json::Value::Object(o) => {
let _ = serde_json::from_value::<Parameter>(serde_json::Value::Object(o))
serde_json::Value::Object(_) => {
let _ = serde_json::from_value::<Parameter>(value)
.unwrap_or_else(|_| panic!("Failed to deserialize: {:?}", p));
}
serde_json::Value::Array(_) => {
let _ = serde_json::from_value::<Vec<Parameter>>(value)
.unwrap_or_else(|_| panic!("Failed to deserialize: {:?}", p));
}
_ => panic!("Expected JSON object: {:?}", p),
_ => panic!("Expected JSON object or array: {:?}", p),
}
}
}
Expand Down

0 comments on commit 6999a10

Please sign in to comment.