Skip to content

Commit 8e7389a

Browse files
committed
Change serde test to use char instead of String
1 parent 5cc4a2b commit 8e7389a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/serde.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use serde_test::{Token, assert_tokens};
88

99
#[test]
1010
fn test_ser_de_empty() {
11-
let map = LinkedHashMap::<String, u32>::new();
11+
let map = LinkedHashMap::<char, u32>::new();
1212

1313
assert_tokens(&map, &[
1414
Token::MapStart(Some(0)),
@@ -19,22 +19,22 @@ fn test_ser_de_empty() {
1919
#[test]
2020
fn test_ser_de() {
2121
let mut map = LinkedHashMap::new();
22-
map.insert("b".to_string(), 20);
23-
map.insert("a".to_string(), 10);
24-
map.insert("c".to_string(), 30);
22+
map.insert('b', 20);
23+
map.insert('a', 10);
24+
map.insert('c', 30);
2525

2626
assert_tokens(&map, &[
2727
Token::MapStart(Some(3)),
2828
Token::MapSep,
29-
Token::Str("b"),
29+
Token::Char('b'),
3030
Token::I32(20),
3131

3232
Token::MapSep,
33-
Token::Str("a"),
33+
Token::Char('a'),
3434
Token::I32(10),
3535

3636
Token::MapSep,
37-
Token::Str("c"),
37+
Token::Char('c'),
3838
Token::I32(30),
3939
Token::MapEnd,
4040
]);

0 commit comments

Comments
 (0)