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 2fd4c35 commit 87c4997
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/link/tests/bond.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// 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
2 changes: 1 addition & 1 deletion src/link/tests/geneve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn test_geneve_link_info() {
LinkInfo::Data(InfoData::Geneve(vec![
InfoGeneve::Id(42),
InfoGeneve::Remote6(
Ipv6Addr::from_str("2001:db8::1").unwrap().into(),
Ipv6Addr::from_str("2001:db8::1").unwrap(),
),
InfoGeneve::UdpZeroCsum6Tx(false),
InfoGeneve::Ttl(10),
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
8 changes: 4 additions & 4 deletions src/link/tests/vxlan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ fn test_parsing_link_vxlan() {
LinkInfo::Data(InfoData::Vxlan(vec![
InfoVxlan::Id(101),
InfoVxlan::Group(
Ipv4Addr::from_str("8.8.8.8").unwrap().into(),
Ipv4Addr::from_str("8.8.8.8").unwrap(),
),
InfoVxlan::Link(13),
InfoVxlan::Local(
Ipv4Addr::from_str("1.1.1.1").unwrap().into(),
Ipv4Addr::from_str("1.1.1.1").unwrap(),
),
InfoVxlan::Ttl(0),
InfoVxlan::TtlInherit(false),
Expand Down Expand Up @@ -464,11 +464,11 @@ fn test_parsing_link_vxlan_ipv6() {
LinkInfo::Data(InfoData::Vxlan(vec![
InfoVxlan::Id(12),
InfoVxlan::Group6(
Ipv6Addr::from_str("ff00::1").unwrap().into(),
Ipv6Addr::from_str("ff00::1").unwrap(),
),
InfoVxlan::Link(2),
InfoVxlan::Local6(
Ipv6Addr::from_str("fd01::2").unwrap().into(),
Ipv6Addr::from_str("fd01::2").unwrap(),
),
InfoVxlan::Ttl(0),
InfoVxlan::TtlInherit(false),
Expand Down

0 comments on commit 87c4997

Please sign in to comment.