Skip to content

Commit 32283af

Browse files
committed
clippy
1 parent fb3380d commit 32283af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/blocks/external_ip.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl Block for ExternalIP {
183183
"country_tld" => Value::from_string (ip_info.country_tld),
184184
"continent_code" => Value::from_string (ip_info.continent_code),
185185
"in_eu" => Value::from_boolean (ip_info.in_eu),
186-
"postal" => Value::from_string (ip_info.postal.unwrap_or("No postal code".to_string())),
186+
"postal" => Value::from_string (ip_info.postal.unwrap_or_else(|| "No postal code".to_string())),
187187
"latitude" => Value::from_float (ip_info.latitude),
188188
"longitude" => Value::from_float (ip_info.longitude),
189189
"timezone" => Value::from_string (ip_info.timezone),
@@ -203,7 +203,7 @@ impl Block for ExternalIP {
203203
}
204204
true => {
205205
self.output.set_state(State::Critical);
206-
(format!("Error: {}", ip_info.reason.clone()), false)
206+
(format!("Error: {}", ip_info.reason), false)
207207
}
208208
},
209209
Err(err) => {

0 commit comments

Comments
 (0)