protocols: Fix unit test

Fixes: #6646

Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
Tim Zhang 2023-04-14 10:53:46 +08:00
parent 392732e213
commit 009b42dbff

View File

@ -1056,7 +1056,7 @@ mod tests {
#[test] #[test]
fn test_from_vec_len_0() { fn test_from_vec_len_0() {
let from: Vec<TestA> = vec![]; let from: Vec<TestA> = vec![];
let to: ::protobuf::RepeatedField<TestB> = from_vec(from.clone()); let to: Vec<TestB> = from_vec(from.clone());
assert_eq!(from.len(), to.len()); assert_eq!(from.len(), to.len());
} }
@ -1065,7 +1065,7 @@ mod tests {
let from: Vec<TestA> = vec![TestA { let from: Vec<TestA> = vec![TestA {
from: "a".to_string(), from: "a".to_string(),
}]; }];
let to: ::protobuf::RepeatedField<TestB> = from_vec(from.clone()); let to: Vec<TestB> = from_vec(from.clone());
assert_eq!(from.len(), to.len()); assert_eq!(from.len(), to.len());
assert_eq!(from[0].from, to[0].to); assert_eq!(from[0].from, to[0].to);