Use vec instead of pushing to a mutable vector
Clippy emits: warning: calls to `push` immediately after creation Use `vec` instead of pushing to a mutable vector.
This commit is contained in:
parent
73066e7e48
commit
c0c88fe87d
|
@ -618,19 +618,13 @@ mod test {
|
||||||
let bytes = out;
|
let bytes = out;
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut query = Vec::new();
|
let query = vec![Vec::from_hex("abcdef").unwrap(), Vec::from_hex("eeeeee").unwrap()];
|
||||||
query.push(Vec::from_hex("abcdef").unwrap());
|
|
||||||
query.push(Vec::from_hex("eeeeee").unwrap());
|
|
||||||
|
|
||||||
let reader = GCSFilterReader::new(0, 0, M, P);
|
let reader = GCSFilterReader::new(0, 0, M, P);
|
||||||
let mut input = Cursor::new(bytes.clone());
|
let mut input = Cursor::new(bytes.clone());
|
||||||
assert!(reader.match_any(&mut input, &mut query.iter().map(|v| v.as_slice())).unwrap());
|
assert!(reader.match_any(&mut input, &mut query.iter().map(|v| v.as_slice())).unwrap());
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
let mut query = Vec::new();
|
let query = vec![Vec::from_hex("abcdef").unwrap(), Vec::from_hex("123456").unwrap()];
|
||||||
query.push(Vec::from_hex("abcdef").unwrap());
|
|
||||||
query.push(Vec::from_hex("123456").unwrap());
|
|
||||||
|
|
||||||
let reader = GCSFilterReader::new(0, 0, M, P);
|
let reader = GCSFilterReader::new(0, 0, M, P);
|
||||||
let mut input = Cursor::new(bytes.clone());
|
let mut input = Cursor::new(bytes.clone());
|
||||||
assert!(!reader.match_any(&mut input, &mut query.iter().map(|v| v.as_slice())).unwrap());
|
assert!(!reader.match_any(&mut input, &mut query.iter().map(|v| v.as_slice())).unwrap());
|
||||||
|
|
Loading…
Reference in New Issue