Skip to content

Commit c91b2e9

Browse files
committed
Fix cargo clippy warnings
Signed-off-by: Gris Ge <[email protected]>
1 parent 5246712 commit c91b2e9

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

src/link/tests/bond.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
// SPDX-License-Identifier: MIT
22

3-
use netlink_packet_core::{NetlinkHeader, NetlinkMessage, NetlinkPayload};
43
use netlink_packet_utils::{Emitable, Parseable};
54

65
use crate::link::link_flag::LinkFlags;
76
use crate::link::{
87
BondArpValidate, BondMode, BondPortState, InfoBond, InfoBondPort, InfoData,
98
InfoKind, InfoPortData, InfoPortKind, LinkAttribute, LinkHeader, LinkInfo,
10-
LinkLayerType, LinkMessage, LinkMessageBuffer, LinkXdp, Map, MiiStatus,
11-
State, Stats, Stats64,
9+
LinkLayerType, LinkMessage, LinkMessageBuffer, Map, MiiStatus, State,
1210
};
1311
use crate::{AddressFamily, RouteNetlinkMessage};
1412

src/link/tests/geneve.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ fn test_geneve_link_info() {
4040
LinkInfo::Kind(InfoKind::Geneve),
4141
LinkInfo::Data(InfoData::Geneve(vec![
4242
InfoGeneve::Id(42),
43-
InfoGeneve::Remote6(
44-
Ipv6Addr::from_str("2001:db8::1").unwrap().into(),
45-
),
43+
InfoGeneve::Remote6(Ipv6Addr::from_str("2001:db8::1").unwrap()),
4644
InfoGeneve::UdpZeroCsum6Tx(false),
4745
InfoGeneve::Ttl(10),
4846
InfoGeneve::Tos(18),

src/link/tests/vrf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ fn test_link_info_with_ifla_vrf_port_table() {
352352
};
353353
let link = LinkMessage::parse(&LinkMessageBuffer::new(&data)).unwrap();
354354
assert_eq!(expected, link);
355-
let mut buf = vec![0; data.len()];
355+
let _buf = vec![0; data.len()];
356356
// FIXME: the packet we write is not a perfect match with the
357357
// packet we received from the kernel.
358358
//

src/link/tests/vxlan.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,9 @@ fn test_parsing_link_vxlan() {
229229
LinkInfo::Kind(InfoKind::Vxlan),
230230
LinkInfo::Data(InfoData::Vxlan(vec![
231231
InfoVxlan::Id(101),
232-
InfoVxlan::Group(
233-
Ipv4Addr::from_str("8.8.8.8").unwrap().into(),
234-
),
232+
InfoVxlan::Group(Ipv4Addr::from_str("8.8.8.8").unwrap()),
235233
InfoVxlan::Link(13),
236-
InfoVxlan::Local(
237-
Ipv4Addr::from_str("1.1.1.1").unwrap().into(),
238-
),
234+
InfoVxlan::Local(Ipv4Addr::from_str("1.1.1.1").unwrap()),
239235
InfoVxlan::Ttl(0),
240236
InfoVxlan::TtlInherit(false),
241237
InfoVxlan::Tos(0),
@@ -463,13 +459,9 @@ fn test_parsing_link_vxlan_ipv6() {
463459
LinkInfo::Kind(InfoKind::Vxlan),
464460
LinkInfo::Data(InfoData::Vxlan(vec![
465461
InfoVxlan::Id(12),
466-
InfoVxlan::Group6(
467-
Ipv6Addr::from_str("ff00::1").unwrap().into(),
468-
),
462+
InfoVxlan::Group6(Ipv6Addr::from_str("ff00::1").unwrap()),
469463
InfoVxlan::Link(2),
470-
InfoVxlan::Local6(
471-
Ipv6Addr::from_str("fd01::2").unwrap().into(),
472-
),
464+
InfoVxlan::Local6(Ipv6Addr::from_str("fd01::2").unwrap()),
473465
InfoVxlan::Ttl(0),
474466
InfoVxlan::TtlInherit(false),
475467
InfoVxlan::Tos(0),

0 commit comments

Comments
 (0)