From 0b4c0758bb571c851e92af26513b5dcd6d75e52a Mon Sep 17 00:00:00 2001 From: Daniel Karzel Date: Wed, 3 Mar 2021 15:56:58 +1100 Subject: [PATCH] Turbofish syntax This way, we are co-locating the type with the expression that requires it. This makes it easier to take this expression and compose it with other ones without having to touch the type hint on the variable. Co-authored-by: Thomas Eizinger --- monero-rpc/src/rpc/wallet.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/monero-rpc/src/rpc/wallet.rs b/monero-rpc/src/rpc/wallet.rs index 46804221..bd44cede 100644 --- a/monero-rpc/src/rpc/wallet.rs +++ b/monero-rpc/src/rpc/wallet.rs @@ -44,7 +44,7 @@ impl Client { debug!("get address RPC response: {}", response); - let r: Response = serde_json::from_str(&response)?; + let r = serde_json::from_str::>(&response)?; Ok(r.result) } @@ -69,9 +69,9 @@ impl Client { index, response ); - let res: Response = serde_json::from_str(&response)?; + let r = serde_json::from_str::>(&response)?; - let balance = res.result.balance; + let balance = r.result.balance; Ok(balance) } @@ -93,7 +93,7 @@ impl Client { debug!("create account RPC response: {}", response); - let r: Response = serde_json::from_str(&response)?; + let r = serde_json::from_str::>(&response)?; Ok(r.result) } @@ -115,7 +115,7 @@ impl Client { debug!("get accounts RPC response: {}", response); - let r: Response = serde_json::from_str(&response)?; + let r = serde_json::from_str::>(&response)?; Ok(r.result) } @@ -233,7 +233,7 @@ impl Client { debug!("transfer RPC response: {}", response); - let r: Response = serde_json::from_str(&response)?; + let r = serde_json::from_str::>(&response)?; Ok(r.result) } @@ -252,7 +252,7 @@ impl Client { debug!("wallet height RPC response: {}", response); - let r: Response = serde_json::from_str(&response)?; + let r = serde_json::from_str::>(&response)?; Ok(r.result) } @@ -281,7 +281,7 @@ impl Client { debug!("transfer RPC response: {}", response); - let r: Response = serde_json::from_str(&response)?; + let r = serde_json::from_str::>(&response)?; Ok(r.result) } @@ -314,7 +314,7 @@ impl Client { debug!("generate_from_keys RPC response: {}", response); - let r: Response = serde_json::from_str(&response)?; + let r = serde_json::from_str::>(&response)?; Ok(r.result) } @@ -332,7 +332,7 @@ impl Client { debug!("refresh RPC response: {}", response); - let r: Response = serde_json::from_str(&response)?; + let r = serde_json::from_str::>(&response)?; Ok(r.result) } @@ -354,7 +354,7 @@ impl Client { debug!("sweep_all RPC response: {}", response); - let r: Response = serde_json::from_str(&response)?; + let r = serde_json::from_str::>(&response)?; Ok(r.result) } }