Formatting & clippy

This commit is contained in:
Alex 2022-02-21 12:04:09 +01:00
parent 3b8bff6341
commit 706a3b4ac4
Signed by: lx
GPG key ID: 0E496D15096376BE
4 changed files with 11 additions and 9 deletions

View file

@ -1,8 +1,8 @@
use std::borrow::Borrow;
use std::collections::HashMap;
use std::net::SocketAddr;
use std::sync::atomic::{self, AtomicU32};
use std::sync::{Arc, Mutex};
use std::borrow::Borrow;
use arc_swap::ArcSwapOption;
use log::{debug, error, trace};
@ -120,10 +120,10 @@ impl ClientConn {
self.query_send.store(None);
}
pub(crate) async fn call<'a, T, B>(
pub(crate) async fn call<T, B>(
self: Arc<Self>,
rq: B,
path: &'a str,
path: &str,
prio: RequestPriority,
) -> Result<<T as Message>::Response, Error>
where

View file

@ -1,6 +1,6 @@
use std::borrow::Borrow;
use std::marker::PhantomData;
use std::sync::Arc;
use std::borrow::Borrow;
use arc_swap::ArcSwapOption;
use async_trait::async_trait;
@ -94,8 +94,10 @@ where
target: &NodeID,
req: B,
prio: RequestPriority,
) -> Result<<M as Message>::Response, Error>
where B: Borrow<M> {
) -> Result<<M as Message>::Response, Error>
where
B: Borrow<M>,
{
if *target == self.netapp.id {
match self.handler.load_full() {
None => Err(Error::NoHandler),

View file

@ -19,8 +19,8 @@ pub mod util;
pub mod endpoint;
pub mod proto;
mod proto2;
mod client;
mod proto2;
mod server;
pub mod netapp;

View file

@ -1,5 +1,5 @@
use crate::proto::*;
use crate::error::*;
use crate::proto::*;
pub(crate) struct QueryMessage<'a> {
pub(crate) prio: RequestPriority,
@ -58,7 +58,7 @@ impl<'a> QueryMessage<'a> {
let path = &bytes[2..2 + path_length];
let telemetry_id = if telemetry_id_len > 0 {
Some(bytes[3 + path_length .. 3 + path_length + telemetry_id_len].to_vec())
Some(bytes[3 + path_length..3 + path_length + telemetry_id_len].to_vec())
} else {
None
};