Skip to content

Commit

Permalink
lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
surinder83singh committed Oct 5, 2023
1 parent 6125e90 commit 3359b65
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 18 deletions.
1 change: 1 addition & 0 deletions kos/src/imports.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub use crate::core::MetricsCtl;
pub use crate::core::*;
pub use crate::error::Error;
pub use crate::ipc::*;
Expand Down
1 change: 0 additions & 1 deletion rpc/grpc/client/src/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ macro_rules! route {
return __ret;
}
let __self = self;
let request = request;
let __ret: RpcResult<[<$name Response>]> =
{ __self.inner.call(RpcApiOps::$name, request).await?.as_ref().try_into() };
#[allow(unreachable_code)]
Expand Down
10 changes: 0 additions & 10 deletions rpc/grpc/server/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ impl Connection {
match payload {
Payload::NotifyBlockAddedRequest(ref request) => match kaspa_rpc_core::NotifyBlockAddedRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(listener_id, Scope::BlockAdded(BlockAddedScope::default()), request.command)
Expand All @@ -328,7 +327,6 @@ impl Connection {
Payload::NotifyVirtualChainChangedRequest(ref request) => {
match kaspa_rpc_core::NotifyVirtualChainChangedRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -348,7 +346,6 @@ impl Connection {
Payload::NotifyFinalityConflictRequest(ref request) => {
match kaspa_rpc_core::NotifyFinalityConflictRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand Down Expand Up @@ -376,7 +373,6 @@ impl Connection {
Payload::NotifyUtxosChangedRequest(ref request) => {
match kaspa_rpc_core::NotifyUtxosChangedRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -394,7 +390,6 @@ impl Connection {
Payload::NotifySinkBlueScoreChangedRequest(ref request) => {
match kaspa_rpc_core::NotifySinkBlueScoreChangedRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -412,7 +407,6 @@ impl Connection {
Payload::NotifyVirtualDaaScoreChangedRequest(ref request) => {
match kaspa_rpc_core::NotifyVirtualDaaScoreChangedRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -430,7 +424,6 @@ impl Connection {
Payload::NotifyPruningPointUtxoSetOverrideRequest(ref request) => {
match kaspa_rpc_core::NotifyPruningPointUtxoSetOverrideRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -448,7 +441,6 @@ impl Connection {
Payload::NotifyNewBlockTemplateRequest(ref request) => {
match kaspa_rpc_core::NotifyNewBlockTemplateRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -468,7 +460,6 @@ impl Connection {
let response: StopNotifyingUtxosChangedResponseMessage =
match kaspa_rpc_core::NotifyUtxosChangedRequest::try_from(&notify_request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -489,7 +480,6 @@ impl Connection {
let response: StopNotifyingPruningPointUtxoSetOverrideResponseMessage =
match kaspa_rpc_core::NotifyPruningPointUtxoSetOverrideRequest::try_from(&notify_request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand Down
9 changes: 3 additions & 6 deletions wallet/core/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,13 @@ where
None
};

let list = if list.is_none() {
Value::Object(Map::from_iter(<K as DefaultSettings>::defaults().await.into_iter().map(|(k, v)| {
let list =
list.unwrap_or(Value::Object(Map::from_iter(<K as DefaultSettings>::defaults().await.into_iter().map(|(k, v)| {
let ks = to_value(k).unwrap();
let ks = ks.as_str().expect("Unable to convert key to string");

(ks.to_string(), v)
})))
} else {
list.unwrap()
};
}))));

self.map.clear();
if let Value::Object(map) = list {
Expand Down
2 changes: 1 addition & 1 deletion wallet/core/src/utxo/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub struct UtxoProcessor {

impl UtxoProcessor {
pub fn new(rpc: Option<Rpc>, network_id: Option<NetworkId>, multiplexer: Option<Multiplexer<Box<Events>>>) -> Self {
let multiplexer = multiplexer.unwrap_or_else(Multiplexer::new);
let multiplexer = multiplexer.unwrap_or_default();
UtxoProcessor { inner: Arc::new(Inner::new(rpc, network_id, multiplexer)) }
}

Expand Down

0 comments on commit 3359b65

Please sign in to comment.