Skip to content

Commit 35e84ab

Browse files
committed
vsock: fix non_local_definitions warning
Remove unnecessary `impl` by inlining the method call body into the place that calls it directly. Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
1 parent fadbbc1 commit 35e84ab

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

virtio-vsock/src/packet.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,14 +1381,6 @@ mod tests {
13811381
fn test_set_header_field_with_invalid_offset() {
13821382
const INVALID_OFFSET: usize = 50;
13831383

1384-
impl<'a, B: BitmapSlice> VsockPacket<'a, B> {
1385-
/// Set the `src_cid` of the header, but use an invalid offset for that.
1386-
pub fn set_src_cid_invalid(&mut self, cid: u64) -> &mut Self {
1387-
set_header_field!(self, src_cid, INVALID_OFFSET, cid);
1388-
self
1389-
}
1390-
}
1391-
13921384
let mem: GuestMemoryMmap =
13931385
GuestMemoryMmap::from_ranges(&[(GuestAddress(0), 0x30_0000)]).unwrap();
13941386
// The `build_desc_chain` function will populate the `NEXT` related flags and field.
@@ -1401,6 +1393,7 @@ mod tests {
14011393

14021394
let mut packet =
14031395
VsockPacket::from_rx_virtq_chain(&mem, &mut chain, MAX_PKT_BUF_SIZE).unwrap();
1404-
packet.set_src_cid_invalid(SRC_CID);
1396+
// Set the `src_cid` of the header, but use an invalid offset for that.
1397+
set_header_field!(packet, src_cid, INVALID_OFFSET, SRC_CID);
14051398
}
14061399
}

0 commit comments

Comments
 (0)