Skip to content

Commit 86a98d3

Browse files
committed
style: fix formatting in map-of-maps tests
1 parent f90261e commit 86a98d3

File tree

2 files changed

+29
-11
lines changed

2 files changed

+29
-11
lines changed

aya/src/maps/of_maps/array.rs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,7 @@ mod tests {
196196
aya_obj::generated::bpf_map_type::BPF_MAP_TYPE_HASH,
197197
));
198198
let map = Map::HashMap(map);
199-
assert_matches!(
200-
Array::try_from(&map),
201-
Err(MapError::InvalidMapType { .. })
202-
);
199+
assert_matches!(Array::try_from(&map), Err(MapError::InvalidMapType { .. }));
203200
}
204201

205202
#[test]
@@ -220,7 +217,10 @@ mod tests {
220217

221218
assert_matches!(
222219
arr.set(0, inner_map.fd(), 0),
223-
Err(MapError::SyscallError(SyscallError { call: "bpf_map_update_elem", .. }))
220+
Err(MapError::SyscallError(SyscallError {
221+
call: "bpf_map_update_elem",
222+
..
223+
}))
224224
);
225225
}
226226

@@ -251,7 +251,10 @@ mod tests {
251251
));
252252
let mut arr = Array::new(&mut map).unwrap();
253253

254-
assert_matches!(arr.set(1024, inner_map.fd(), 0), Err(MapError::OutOfBounds { .. }));
254+
assert_matches!(
255+
arr.set(1024, inner_map.fd(), 0),
256+
Err(MapError::OutOfBounds { .. })
257+
);
255258
}
256259

257260
#[test]
@@ -264,7 +267,10 @@ mod tests {
264267
let result = arr.get::<u32>(&0, 0);
265268
assert!(matches!(
266269
result,
267-
Err(MapError::SyscallError(SyscallError { call: "bpf_map_lookup_elem", .. }))
270+
Err(MapError::SyscallError(SyscallError {
271+
call: "bpf_map_lookup_elem",
272+
..
273+
}))
268274
));
269275
}
270276

@@ -289,6 +295,9 @@ mod tests {
289295
let map = new_map(new_obj_map());
290296
let arr = Array::new(&map).unwrap();
291297

292-
assert!(matches!(arr.get::<u32>(&1024, 0), Err(MapError::OutOfBounds { .. })));
298+
assert!(matches!(
299+
arr.get::<u32>(&1024, 0),
300+
Err(MapError::OutOfBounds { .. })
301+
));
293302
}
294303
}

aya/src/maps/of_maps/hash_map.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@ mod tests {
215215

216216
assert_matches!(
217217
hm.insert(1, inner_map.fd(), 0),
218-
Err(MapError::SyscallError(SyscallError { call: "bpf_map_update_elem", .. }))
218+
Err(MapError::SyscallError(SyscallError {
219+
call: "bpf_map_update_elem",
220+
..
221+
}))
219222
);
220223
}
221224

@@ -247,7 +250,10 @@ mod tests {
247250

248251
assert_matches!(
249252
hm.remove(&1),
250-
Err(MapError::SyscallError(SyscallError { call: "bpf_map_delete_elem", .. }))
253+
Err(MapError::SyscallError(SyscallError {
254+
call: "bpf_map_delete_elem",
255+
..
256+
}))
251257
);
252258
}
253259

@@ -276,7 +282,10 @@ mod tests {
276282

277283
assert_matches!(
278284
hm.get::<u32, u32>(&1, 0),
279-
Err(MapError::SyscallError(SyscallError { call: "bpf_map_lookup_elem", .. }))
285+
Err(MapError::SyscallError(SyscallError {
286+
call: "bpf_map_lookup_elem",
287+
..
288+
}))
280289
);
281290
}
282291

0 commit comments

Comments
 (0)