Bladeren bron

Some Clippy changes

Benjamin Sago 4 jaren geleden
bovenliggende
commit
7ccb66e73d
5 gewijzigde bestanden met toevoegingen van 7 en 5 verwijderingen
  1. 3 1
      dns/src/lib.rs
  2. 1 1
      dns/src/record/eui48.rs
  3. 1 1
      dns/src/record/eui64.rs
  4. 1 2
      dns/src/strings.rs
  5. 1 0
      src/main.rs

+ 3 - 1
dns/src/lib.rs

@@ -11,12 +11,14 @@
 
 #![warn(clippy::all, clippy::pedantic)]
 #![allow(clippy::doc_markdown)]
-#![allow(clippy::find_map)]
+#![allow(clippy::len_without_is_empty)]
 #![allow(clippy::missing_errors_doc)]
 #![allow(clippy::module_name_repetitions)]
 #![allow(clippy::must_use_candidate)]
 #![allow(clippy::non_ascii_literal)]
+#![allow(clippy::redundant_else)]
 #![allow(clippy::struct_excessive_bools)]
+#![allow(clippy::upper_case_acronyms)]
 #![allow(clippy::wildcard_imports)]
 
 #![deny(clippy::cast_possible_truncation)]

+ 1 - 1
dns/src/record/eui48.rs

@@ -39,7 +39,7 @@ impl Wire for EUI48 {
 impl EUI48 {
 
     /// Returns this EUI as hexadecimal numbers, separated by dashes.
-    pub fn formatted_address(&self) -> String {
+    pub fn formatted_address(self) -> String {
         format!("{:02x}-{:02x}-{:02x}-{:02x}-{:02x}-{:02x}",
                 self.octets[0], self.octets[1], self.octets[2],
                 self.octets[3], self.octets[4], self.octets[5])

+ 1 - 1
dns/src/record/eui64.rs

@@ -39,7 +39,7 @@ impl Wire for EUI64 {
 impl EUI64 {
 
     /// Returns this EUI as hexadecimal numbers, separated by dashes.
-    pub fn formatted_address(&self) -> String {
+    pub fn formatted_address(self) -> String {
         format!("{:02x}-{:02x}-{:02x}-{:02x}-{:02x}-{:02x}-{:02x}-{:02x}",
                 self.octets[0], self.octets[1], self.octets[2], self.octets[3],
                 self.octets[4], self.octets[5], self.octets[6], self.octets[7])

+ 1 - 2
dns/src/strings.rs

@@ -4,7 +4,6 @@ use std::convert::TryFrom;
 use std::fmt;
 use std::io::{self, Write};
 
-use unic_idna;
 use byteorder::{ReadBytesExt, WriteBytesExt};
 use log::*;
 
@@ -47,7 +46,7 @@ impl Labels {
             let label_idn = label_to_ascii(label)
                     .map_err(|e| {
                         warn!("Could not encode label {:?}: {:?}", label, e);
-                        return label;
+                        label
                     })?;
 
             match u8::try_from(label_idn.len()) {

+ 1 - 0
src/main.rs

@@ -18,6 +18,7 @@
 #![allow(clippy::too_many_lines)]
 #![allow(clippy::unit_arg)]
 #![allow(clippy::unused_self)]
+#![allow(clippy::upper_case_acronyms)]
 #![allow(clippy::useless_let_if_seq)]
 #![allow(clippy::wildcard_imports)]