Skip to content

Commit 61edf52

Browse files
committed
Update message text
1 parent 4b8adc6 commit 61edf52

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/resp.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl<K: FromResp + Hash + Eq, T: FromResp> FromResp for HashMap<K, T> {
199199
while let Some(k) = items.next() {
200200
let key = K::from_resp(k)?;
201201
let value = T::from_resp(items.next().ok_or(error::resp(
202-
"Cannot convert odd number of elements into a hashmap",
202+
"Cannot convert an odd number of elements into a hashmap",
203203
"".into(),
204204
))?)?;
205205

@@ -723,12 +723,7 @@ mod tests {
723723
}
724724

725725
#[test]
726-
fn test_hashmap_conversion_fails_with_uneven() {
727-
let mut expected = HashMap::new();
728-
expected.insert("KEY1".to_string(), "VALUE1".to_string());
729-
expected.insert("KEY2".to_string(), "VALUE2".to_string());
730-
expected.insert("KEY3".to_string(), "VALUE3".to_string());
731-
726+
fn test_hashmap_conversion_fails_with_odd_length_array() {
732727
let resp_object = RespValue::Array(vec![
733728
"KEY1".into(),
734729
"VALUE1".into(),
@@ -740,7 +735,7 @@ mod tests {
740735

741736
match res {
742737
Err(Error::RESP(_, _)) => {}
743-
_ => panic!("Converted to an uneven array of elements to a hashmap"),
738+
_ => panic!("Should not be able to convert an odd number of elements to a hashmap"),
744739
}
745740
}
746741
}

0 commit comments

Comments
 (0)