add use_self clippy lint (#8325)

This commit is contained in:
Thomas Coratger
2024-05-29 15:14:14 +02:00
committed by GitHub
parent 0cb5358fef
commit 19c529e8df
200 changed files with 1817 additions and 1954 deletions

View File

@ -284,7 +284,7 @@ pub struct RpcServiceBuilder<L>(tower::ServiceBuilder<L>);
impl Default for RpcServiceBuilder<Identity> {
fn default() -> Self {
RpcServiceBuilder(tower::ServiceBuilder::new())
Self(tower::ServiceBuilder::new())
}
}
@ -577,7 +577,7 @@ pub struct Builder<HttpMiddleware, RpcMiddleware> {
impl Default for Builder<Identity, Identity> {
fn default() -> Self {
Builder {
Self {
settings: Settings::default(),
id_provider: Arc::new(RandomIntegerIdProvider),
rpc_middleware: RpcServiceBuilder::new(),

View File

@ -43,7 +43,7 @@ pub enum Separator {
impl Default for Separator {
fn default() -> Self {
Separator::Byte(b'\n')
Self::Byte(b'\n')
}
}
@ -57,12 +57,12 @@ pub struct StreamCodec {
impl StreamCodec {
/// Default codec with streaming input data. Input can be both enveloped and not.
pub fn stream_incoming() -> Self {
StreamCodec::new(Separator::Empty, Default::default())
Self::new(Separator::Empty, Default::default())
}
/// New custom stream codec
pub fn new(incoming_separator: Separator, outgoing_separator: Separator) -> Self {
StreamCodec { incoming_separator, outgoing_separator }
Self { incoming_separator, outgoing_separator }
}
}