Skip to content

Commit

Permalink
Fix cargo clippy warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Gris Ge <[email protected]>
  • Loading branch information
cathay4t committed Sep 4, 2024
1 parent 5246712 commit c91b2e9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 19 deletions.
4 changes: 1 addition & 3 deletions src/link/tests/bond.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// SPDX-License-Identifier: MIT

use netlink_packet_core::{NetlinkHeader, NetlinkMessage, NetlinkPayload};
use netlink_packet_utils::{Emitable, Parseable};

use crate::link::link_flag::LinkFlags;
use crate::link::{
BondArpValidate, BondMode, BondPortState, InfoBond, InfoBondPort, InfoData,
InfoKind, InfoPortData, InfoPortKind, LinkAttribute, LinkHeader, LinkInfo,
LinkLayerType, LinkMessage, LinkMessageBuffer, LinkXdp, Map, MiiStatus,
State, Stats, Stats64,
LinkLayerType, LinkMessage, LinkMessageBuffer, Map, MiiStatus, State,
};
use crate::{AddressFamily, RouteNetlinkMessage};

Expand Down
4 changes: 1 addition & 3 deletions src/link/tests/geneve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ fn test_geneve_link_info() {
LinkInfo::Kind(InfoKind::Geneve),
LinkInfo::Data(InfoData::Geneve(vec![
InfoGeneve::Id(42),
InfoGeneve::Remote6(
Ipv6Addr::from_str("2001:db8::1").unwrap().into(),
),
InfoGeneve::Remote6(Ipv6Addr::from_str("2001:db8::1").unwrap()),
InfoGeneve::UdpZeroCsum6Tx(false),
InfoGeneve::Ttl(10),
InfoGeneve::Tos(18),
Expand Down
2 changes: 1 addition & 1 deletion src/link/tests/vrf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ fn test_link_info_with_ifla_vrf_port_table() {
};
let link = LinkMessage::parse(&LinkMessageBuffer::new(&data)).unwrap();
assert_eq!(expected, link);
let mut buf = vec![0; data.len()];
let _buf = vec![0; data.len()];
// FIXME: the packet we write is not a perfect match with the
// packet we received from the kernel.
//
Expand Down
16 changes: 4 additions & 12 deletions src/link/tests/vxlan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,9 @@ fn test_parsing_link_vxlan() {
LinkInfo::Kind(InfoKind::Vxlan),
LinkInfo::Data(InfoData::Vxlan(vec![
InfoVxlan::Id(101),
InfoVxlan::Group(
Ipv4Addr::from_str("8.8.8.8").unwrap().into(),
),
InfoVxlan::Group(Ipv4Addr::from_str("8.8.8.8").unwrap()),
InfoVxlan::Link(13),
InfoVxlan::Local(
Ipv4Addr::from_str("1.1.1.1").unwrap().into(),
),
InfoVxlan::Local(Ipv4Addr::from_str("1.1.1.1").unwrap()),
InfoVxlan::Ttl(0),
InfoVxlan::TtlInherit(false),
InfoVxlan::Tos(0),
Expand Down Expand Up @@ -463,13 +459,9 @@ fn test_parsing_link_vxlan_ipv6() {
LinkInfo::Kind(InfoKind::Vxlan),
LinkInfo::Data(InfoData::Vxlan(vec![
InfoVxlan::Id(12),
InfoVxlan::Group6(
Ipv6Addr::from_str("ff00::1").unwrap().into(),
),
InfoVxlan::Group6(Ipv6Addr::from_str("ff00::1").unwrap()),
InfoVxlan::Link(2),
InfoVxlan::Local6(
Ipv6Addr::from_str("fd01::2").unwrap().into(),
),
InfoVxlan::Local6(Ipv6Addr::from_str("fd01::2").unwrap()),
InfoVxlan::Ttl(0),
InfoVxlan::TtlInherit(false),
InfoVxlan::Tos(0),
Expand Down

0 comments on commit c91b2e9

Please sign in to comment.