Skip to content

Commit f79ae27

Browse files
authored
Lock nightly and fix some warnings (#157)
* primitives - big_num - fix `clippy` warnings about `to_owned()` * Lock `nightly` version in `rust-toolchain` & `travis`, fix `rustfmt` & `clippy` warnings
1 parent a0fd956 commit f79ae27

File tree

7 files changed

+13
-14
lines changed

7 files changed

+13
-14
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: rust
22
rust:
3-
- nightly
3+
- nightly-2019-10-14
44
cache: cargo
55
env:
66
global:

adapter/src/ethereum.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,7 @@ mod test {
477477
"eyJ0eXBlIjoiSldUIiwiYWxnIjoiRVRIIn0.eyJpZCI6ImF3ZXNvbWVWYWxpZGF0b3IiLCJlcmEiOjEwMDAwMCwiYWRkcmVzcyI6IjB4MmJEZUFGQUU1Mzk0MDY2OURhQTZGNTE5MzczZjY4NmMxZjNkMzM5MyJ9.gGw_sfnxirENdcX5KJQWaEt4FVRvfEjSLD4f3OiPrJIltRadeYP2zWy9T2GYcK5xxD96vnqAw4GebAW7rMlz4xw";
478478
assert_eq!(response, expected, "generated wrong ewt signature");
479479

480-
let expected_verification_response =
481-
r#"VerifyPayload { from: "0x2bDeAFAE53940669DaA6F519373f686c1f3d3393", payload: Payload { id: "awesomeValidator", era: 100000, address: Some("0x2bDeAFAE53940669DaA6F519373f686c1f3d3393"), identity: None } }"#;
480+
let expected_verification_response = r#"VerifyPayload { from: "0x2bDeAFAE53940669DaA6F519373f686c1f3d3393", payload: Payload { id: "awesomeValidator", era: 100000, address: Some("0x2bDeAFAE53940669DaA6F519373f686c1f3d3393"), identity: None } }"#;
482481

483482
let parts: Vec<&str> = expected.split('.').collect();
484483
let verification =

adapter/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl EthereumChannel {
175175

176176
pub fn hash_hex(&self, contract_addr: &str) -> Result<String, Box<dyn Error>> {
177177
let result = self.hash(contract_addr)?;
178-
Ok(format!("0x{}", hex::encode(result).to_string()))
178+
Ok(format!("0x{}", hex::encode(result)))
179179
}
180180

181181
pub fn to_solidity_tuple(&self) -> Vec<String> {
@@ -203,7 +203,7 @@ impl EthereumChannel {
203203
balance_root: &str,
204204
) -> Result<String, Box<dyn Error>> {
205205
let result = self.hash_to_sign(contract_addr, balance_root)?;
206-
Ok(format!("0x{}", hex::encode(result).to_string()))
206+
Ok(format!("0x{}", hex::encode(result)))
207207
}
208208
}
209209

adview-manager/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ fn get_unit_html(
291291
</div>
292292
", target_url = ad_unit.target_url, size = style_size, element_html = element_html, adex_icon = adex_icon);
293293

294-
result.to_string()
294+
result
295295
}
296296

297297
#[cfg(test)]

primitives/src/big_num.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl Add<&BigNum> for &BigNum {
9191

9292
fn add(self, rhs: &BigNum) -> Self::Output {
9393
let big_uint = &self.0 + &rhs.0;
94-
BigNum(big_uint.to_owned())
94+
BigNum(big_uint)
9595
}
9696
}
9797

@@ -106,7 +106,7 @@ impl Sub<&BigNum> for &BigNum {
106106

107107
fn sub(self, rhs: &BigNum) -> Self::Output {
108108
let big_uint = &self.0 - &rhs.0;
109-
BigNum(big_uint.to_owned())
109+
BigNum(big_uint)
110110
}
111111
}
112112

@@ -115,7 +115,7 @@ impl Div<&BigNum> for &BigNum {
115115

116116
fn div(self, rhs: &BigNum) -> Self::Output {
117117
let big_uint = &self.0 / &rhs.0;
118-
BigNum(big_uint.to_owned())
118+
BigNum(big_uint)
119119
}
120120
}
121121

@@ -124,7 +124,7 @@ impl Div<&BigNum> for BigNum {
124124

125125
fn div(self, rhs: &BigNum) -> Self::Output {
126126
let big_uint = &self.0 / &rhs.0;
127-
BigNum(big_uint.to_owned())
127+
BigNum(big_uint)
128128
}
129129
}
130130

@@ -133,7 +133,7 @@ impl Mul<&BigNum> for &BigNum {
133133

134134
fn mul(self, rhs: &BigNum) -> Self::Output {
135135
let big_uint = &self.0 * &rhs.0;
136-
BigNum(big_uint.to_owned())
136+
BigNum(big_uint)
137137
}
138138
}
139139

@@ -142,7 +142,7 @@ impl Mul<&BigNum> for BigNum {
142142

143143
fn mul(self, rhs: &BigNum) -> Self::Output {
144144
let big_uint = &self.0 * &rhs.0;
145-
BigNum(big_uint.to_owned())
145+
BigNum(big_uint)
146146
}
147147
}
148148

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly
1+
nightly-2019-10-14

validator_worker/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn main() {
101101
// @TODO work in separate pull request
102102
fn run(_is_single_tick: bool, sentry: &str, config: &Config, adapter: impl Adapter + 'static) {
103103
let _sentry_url = sentry.to_owned();
104-
let _adapter = adapter.clone();
104+
let _adapter = adapter;
105105
let _config = config.clone();
106106

107107
// let result = async move {

0 commit comments

Comments
 (0)