chore: fix lint warnings across the board (#374)

This commit is contained in:
Santiago Carmuega 2024-01-04 09:47:04 -03:00 committed by GitHub
parent 972102aed8
commit 9200663c8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 31 additions and 31 deletions

View file

@ -262,12 +262,10 @@ impl NodeClient {
) -> Result<Self, Error> {
let pipe_name = pipe_name.as_ref().to_os_string();
let bearer = tokio::task::spawn_blocking(move || {
Bearer::connect_named_pipe(pipe_name)
})
.await
.expect("can't join tokio thread")
.map_err(Error::ConnectFailure)?;
let bearer = tokio::task::spawn_blocking(move || Bearer::connect_named_pipe(pipe_name))
.await
.expect("can't join tokio thread")
.map_err(Error::ConnectFailure)?;
let mut client = Self::new(bearer);

View file

@ -6,6 +6,5 @@ mod protocol;
mod server;
pub use client::*;
pub use codec::*;
pub use protocol::*;
pub use server::*;

View file

@ -6,6 +6,5 @@ mod server;
pub use buffer::*;
pub use client::*;
pub use codec::*;
pub use protocol::*;
pub use server::*;

View file

@ -3,5 +3,4 @@ mod codec;
mod protocol;
pub use client::*;
pub use codec::*;
pub use protocol::*;

View file

@ -6,6 +6,5 @@ mod server;
pub mod queries_v16;
pub use client::*;
pub use codec::*;
pub use protocol::*;
pub use server::*;

View file

@ -1,5 +1,4 @@
pub use client::*;
pub use codec::*;
pub use protocol::*;
mod client;

View file

@ -3,5 +3,4 @@ mod codec;
mod protocol;
pub use client::*;
pub use codec::*;
pub use protocol::*;

View file

@ -4,6 +4,5 @@ mod protocol;
mod server;
pub use client::*;
pub use codec::*;
pub use protocol::*;
pub use server::*;

View file

@ -5,7 +5,7 @@ use std::collections::HashMap;
use byteorder::{ByteOrder, NetworkEndian};
use pallas_codec::{minicbor, Fragment};
use thiserror::Error;
use tokio::io::{AsyncReadExt, AsyncWriteExt, ReadHalf, WriteHalf};
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::task::JoinHandle;
use tokio::time::Instant;
use tokio::{select, sync::mpsc::error::SendError};
@ -21,6 +21,9 @@ use tokio::net as unix;
#[cfg(windows)]
use tokio::net::windows::named_pipe::NamedPipeClient;
#[cfg(windows)]
use tokio::io::{ReadHalf, WriteHalf};
const HEADER_LEN: usize = 8;
pub type Timestamp = u32;
@ -126,9 +129,8 @@ impl Bearer {
}
#[cfg(windows)]
pub fn connect_named_pipe(pipe_name: impl AsRef<std::ffi::OsStr>) ->
IOResult<Self> { let client =
tokio::net::windows::named_pipe::ClientOptions::new().open(&pipe_name)?;
pub fn connect_named_pipe(pipe_name: impl AsRef<std::ffi::OsStr>) -> IOResult<Self> {
let client = tokio::net::windows::named_pipe::ClientOptions::new().open(&pipe_name)?;
Ok(Self::NamedPipe(client))
}
@ -174,7 +176,7 @@ impl BearerReadHalf {
#[cfg(unix)]
BearerReadHalf::Unix(x) => x.read_exact(buf).await,
#[cfg(windows)]
BearerReadHalf::NamedPipe(x) => x.read_exact(buf).await,
}