Silence a few warnings from clippy

These were flagged by `cargo clippy`:

    warning: the operation is ineffective. Consider reducing it to `number`
    warning: this function has too many arguments (8/7)
    warning: you should consider adding a `Default` implementation for
             `phy::loopback::Loopback`

I like the code better as it is.
This commit is contained in:
Alex Crawford 2020-12-28 21:09:07 -08:00
parent 8a961b7d7c
commit 27232041e7
4 changed files with 4 additions and 0 deletions

View File

@ -92,6 +92,7 @@ compile_error!("at least one socket needs to be enabled"); */
#![allow(clippy::manual_non_exhaustive)]
#![allow(clippy::match_like_matches_macro)]
#![allow(clippy::redundant_field_names)]
#![allow(clippy::identity_op)]
#[cfg(feature = "alloc")]
extern crate alloc;

View File

@ -19,6 +19,7 @@ pub struct Loopback {
queue: VecDeque<Vec<u8>>,
}
#[allow(clippy::new_without_default)]
impl Loopback {
/// Creates a loopback device.
///

View File

@ -108,6 +108,7 @@ impl Address {
/// Create an address wrapping an IPv6 address with the given octets.
#[cfg(feature = "proto-ipv6")]
#[allow(clippy::too_many_arguments)]
pub fn v6(a0: u16, a1: u16, a2: u16, a3: u16,
a4: u16, a5: u16, a6: u16, a7: u16) -> Address {
Address::Ipv6(Ipv6Address::new(a0, a1, a2, a3, a4, a5, a6, a7))

View File

@ -47,6 +47,7 @@ impl Address {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]);
/// Construct an IPv6 address from parts.
#[allow(clippy::too_many_arguments)]
pub fn new(a0: u16, a1: u16, a2: u16, a3: u16,
a4: u16, a5: u16, a6: u16, a7: u16) -> Address {
let mut addr = [0u8; 16];