style: simplify string formatting for readability (#231763)

* style: simplify string formatting for readability

* fix: formatting in `.rs` files in `src/`
This commit is contained in:
Hamir Mahal
2024-10-22 09:30:46 -07:00
committed by GitHub
parent aabb725c04
commit a744313eb7
29 changed files with 108 additions and 128 deletions

View File

@@ -105,7 +105,7 @@ impl<S: Serialization, C: Send + Sync + 'static> RpcMethodBuilder<S, C> {
F: Fn(P, &C) -> Result<R, AnyError> + Send + Sync + 'static,
{
if self.methods.contains_key(method_name) {
panic!("Method already registered: {}", method_name);
panic!("Method already registered: {method_name}");
}
let serial = self.serializer.clone();
@@ -121,7 +121,7 @@ impl<S: Serialization, C: Send + Sync + 'static> RpcMethodBuilder<S, C> {
id,
error: ResponseError {
code: 0,
message: format!("{:?}", err),
message: format!("{err:?}"),
},
})
})
@@ -135,7 +135,7 @@ impl<S: Serialization, C: Send + Sync + 'static> RpcMethodBuilder<S, C> {
id,
error: ResponseError {
code: -1,
message: format!("{:?}", err),
message: format!("{err:?}"),
},
})
}),
@@ -165,7 +165,7 @@ impl<S: Serialization, C: Send + Sync + 'static> RpcMethodBuilder<S, C> {
id,
error: ResponseError {
code: 0,
message: format!("{:?}", err),
message: format!("{err:?}"),
},
})
}))
@@ -186,7 +186,7 @@ impl<S: Serialization, C: Send + Sync + 'static> RpcMethodBuilder<S, C> {
id,
error: ResponseError {
code: -1,
message: format!("{:?}", err),
message: format!("{err:?}"),
},
})
}),
@@ -226,7 +226,7 @@ impl<S: Serialization, C: Send + Sync + 'static> RpcMethodBuilder<S, C> {
id,
error: ResponseError {
code: 0,
message: format!("{:?}", err),
message: format!("{err:?}"),
},
})
}))
@@ -259,7 +259,7 @@ impl<S: Serialization, C: Send + Sync + 'static> RpcMethodBuilder<S, C> {
id,
error: ResponseError {
code: -1,
message: format!("{:?}", err),
message: format!("{err:?}"),
},
})
}),
@@ -431,7 +431,7 @@ impl<S: Serialization, C: Send + Sync> RpcDispatcher<S, C> {
id,
error: ResponseError {
code: -1,
message: format!("Method not found: {}", method_name),
message: format!("Method not found: {method_name}"),
},
})
})),