Skip to content

Commit

Permalink
fix new lint errors with rust 1.81
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 committed Oct 16, 2024
1 parent 687f304 commit acd2a9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/network/core_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl CoreUtils {

pub fn decode_address_from_hex(input: &str) -> Result<Vec<u8>, std::io::Error> {
let bytes: Result<Vec<u8>, _> = input
.split(|c| c == ':' || c == '-')
.split([':', '-'])
.map(|b| u8::from_str_radix(b, 16))
.collect();

Expand Down
3 changes: 1 addition & 2 deletions src/network/vlan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ fn setup(
netns
.set_link_name(link.header.index, if_name.to_string())
.wrap(format!("rename tmp {kind_data} interface"))
.map_err(|err| {
.inspect_err(|_| {
// If there is an error here most likely the name in the netns is already used,
// make sure to delete the tmp interface.
if let Err(err) = netns.del_link(netlink::LinkID::ID(link.header.index))
Expand All @@ -346,7 +346,6 @@ fn setup(
kind_data, tmp_name, err
);
};
err
})?;

// successful run, break out of loop
Expand Down

0 comments on commit acd2a9d

Please sign in to comment.