Skip to content

Commit 82221a9

Browse files
committed
Fix Vec initialization in test
Uses `vec![x; N]` instead of `v.resize(N, x)`. Caught by `clippy::slow_vector_initialization`.
1 parent 7ea39f1 commit 82221a9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/unstructured.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,8 +876,7 @@ mod tests {
876876
// Should take one byte off the end
877877
assert_eq!(u.arbitrary_byte_size().unwrap(), 6);
878878
assert_eq!(u.len(), 9);
879-
let mut v = vec![];
880-
v.resize(260, 0);
879+
let mut v = vec![0; 260];
881880
v.push(1);
882881
v.push(4);
883882
let mut u = Unstructured::new(&v);

0 commit comments

Comments
 (0)