From 6765fe930ba00d75f48ea7e20467516b045589e7 Mon Sep 17 00:00:00 2001 From: nm17 Date: Thu, 9 Jan 2025 17:23:48 +0400 Subject: [PATCH] style: minor clippy stuff --- src/ingest_protocol/parser.rs | 6 ++++-- src/main.rs | 1 - src/utils/hifitime_serde.rs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ingest_protocol/parser.rs b/src/ingest_protocol/parser.rs index 085cf1f..1d49108 100644 --- a/src/ingest_protocol/parser.rs +++ b/src/ingest_protocol/parser.rs @@ -111,8 +111,10 @@ pub fn parse_packet(input: &str) -> MyIError<&str, NMDeviceDataPacket> { let (input, opt_name) = opt(delimited(tag("#"), take_while(|c| c != '\n'), tag("\n")))(input)?; - let mut packet = NMDeviceDataPacket::default(); - packet.mac = device_mac; + let mut packet = NMDeviceDataPacket { + mac: device_mac, + ..Default::default() + }; let (input, lines) = context( "Получение значений до тега терминатора", diff --git a/src/main.rs b/src/main.rs index 7808067..fc54154 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,6 @@ mod utils; mod web_server; use crate::web_server::server_main; -struct Params {} #[ntex::main] async fn main() { diff --git a/src/utils/hifitime_serde.rs b/src/utils/hifitime_serde.rs index 07119de..16bcffc 100644 --- a/src/utils/hifitime_serde.rs +++ b/src/utils/hifitime_serde.rs @@ -1,7 +1,7 @@ use hifitime::Epoch; use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; use std::fmt; -use std::fmt::{Formatter, Write}; +use std::fmt::Formatter; #[derive(PartialOrd, PartialEq, Ord, Eq, Clone, Copy, Debug, Default)] #[repr(transparent)] @@ -30,7 +30,7 @@ impl<'de> Deserialize<'de> for EpochUTC { { struct EpochVisitor; - impl<'de> de::Visitor<'de> for EpochVisitor { + impl de::Visitor<'_> for EpochVisitor { type Value = EpochUTC; fn expecting(&self, formatter: &mut Formatter) -> fmt::Result {