aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-02-21 12:04:09 +0100
committerAlex Auvolat <alex@adnab.me>2022-02-21 12:04:09 +0100
commit706a3b4ac46edd3adc344ecb263cb5d2a4a057a3 (patch)
tree719d382e95256617df64d177cc5be0511dfe740a /src
parent3b8bff634198c5ae17ab16d5c85c30b3201ae593 (diff)
downloadnetapp-706a3b4ac46edd3adc344ecb263cb5d2a4a057a3.tar.gz
netapp-706a3b4ac46edd3adc344ecb263cb5d2a4a057a3.zip
Formatting & clippy
Diffstat (limited to 'src')
-rw-r--r--src/client.rs6
-rw-r--r--src/endpoint.rs8
-rw-r--r--src/lib.rs2
-rw-r--r--src/proto2.rs4
4 files changed, 11 insertions, 9 deletions
diff --git a/src/client.rs b/src/client.rs
index e2d5d84..62f876b 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -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
diff --git a/src/endpoint.rs b/src/endpoint.rs
index b408241..bb5399c 100644
--- a/src/endpoint.rs
+++ b/src/endpoint.rs
@@ -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),
diff --git a/src/lib.rs b/src/lib.rs
index 89b4f32..cb24337 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -19,8 +19,8 @@ pub mod util;
pub mod endpoint;
pub mod proto;
-mod proto2;
mod client;
+mod proto2;
mod server;
pub mod netapp;
diff --git a/src/proto2.rs b/src/proto2.rs
index 4e126d3..7210781 100644
--- a/src/proto2.rs
+++ b/src/proto2.rs
@@ -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
};