Formatting & clippy

This commit is contained in:
Alex 2022-02-21 12:04:09 +01:00
parent 3b8bff6341
commit 706a3b4ac4
Signed by untrusted user: 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::collections::HashMap;
use std::net::SocketAddr; use std::net::SocketAddr;
use std::sync::atomic::{self, AtomicU32}; use std::sync::atomic::{self, AtomicU32};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use std::borrow::Borrow;
use arc_swap::ArcSwapOption; use arc_swap::ArcSwapOption;
use log::{debug, error, trace}; use log::{debug, error, trace};
@ -120,10 +120,10 @@ impl ClientConn {
self.query_send.store(None); self.query_send.store(None);
} }
pub(crate) async fn call<'a, T, B>( pub(crate) async fn call<T, B>(
self: Arc<Self>, self: Arc<Self>,
rq: B, rq: B,
path: &'a str, path: &str,
prio: RequestPriority, prio: RequestPriority,
) -> Result<<T as Message>::Response, Error> ) -> Result<<T as Message>::Response, Error>
where where

View file

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

View file

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

View file

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