apply cargo & clippy fixes
Some checks failed
Run Check Script / check (pull_request) Failing after -1m14s

This commit is contained in:
Ian Letourneau
2025-08-04 21:52:45 -04:00
parent 74182bbc60
commit c64b59a4ec
67 changed files with 339 additions and 348 deletions

View File

@@ -1,4 +1,3 @@
use rand;
use rand::Rng;
use xml::reader::XmlEvent as ReadEvent;
use xml::writer::XmlEvent as WriteEvent;
@@ -14,7 +13,7 @@ impl YaDeserializeTrait for HAProxyId {
ReadEvent::StartElement {
name, attributes, ..
} => {
if attributes.len() > 0 {
if !attributes.is_empty() {
return Err(String::from(
"Attributes not currently supported by HAProxyId",
));

View File

@@ -51,7 +51,7 @@ pub struct OPNsense {
impl From<String> for OPNsense {
fn from(content: String) -> Self {
yaserde::de::from_str(&content)
.map_err(|e| println!("{}", e.to_string()))
.map_err(|e| println!("{}", e))
.expect("OPNSense received invalid string, should be full XML")
}
}
@@ -59,7 +59,7 @@ impl From<String> for OPNsense {
impl OPNsense {
pub fn to_xml(&self) -> String {
to_xml_str(self)
.map_err(|e| error!("{}", e.to_string()))
.map_err(|e| error!("{}", e))
.expect("OPNSense could not serialize to XML")
}
}