File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ impl Block for ExternalIP {
183
183
"country_tld" => Value :: from_string ( ip_info. country_tld) ,
184
184
"continent_code" => Value :: from_string ( ip_info. continent_code) ,
185
185
"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( ) ) ) ,
187
187
"latitude" => Value :: from_float ( ip_info. latitude) ,
188
188
"longitude" => Value :: from_float ( ip_info. longitude) ,
189
189
"timezone" => Value :: from_string ( ip_info. timezone) ,
@@ -203,7 +203,7 @@ impl Block for ExternalIP {
203
203
}
204
204
true => {
205
205
self . output . set_state ( State :: Critical ) ;
206
- ( format ! ( "Error: {}" , ip_info. reason. clone ( ) ) , false )
206
+ ( format ! ( "Error: {}" , ip_info. reason) , false )
207
207
}
208
208
} ,
209
209
Err ( err) => {
You can’t perform that action at this time.
0 commit comments