mirror of
https://github.com/serde-rs/json.git
synced 2026-03-01 19:39:06 +00:00
Resolve redundant_closure_for_method_calls pedantic clippy lint
error: redundant closure
--> src/number.rs:133:69
|
133 | return self.n.parse::<f64>().ok().map_or(false, |f| f.is_finite());
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `f64::is_finite`
|
= note: `-D clippy::redundant-closure-for-method-calls` implied by `-D clippy::pedantic`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
This commit is contained in:
parent
f5f23f9b7f
commit
9a6dcf03de
@ -353,7 +353,6 @@
|
||||
clippy::missing_errors_doc,
|
||||
clippy::must_use_candidate,
|
||||
// TODO
|
||||
clippy::redundant_closure_for_method_calls,
|
||||
clippy::semicolon_if_nothing_returned,
|
||||
)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
@ -130,7 +130,7 @@ impl Number {
|
||||
{
|
||||
for c in self.n.chars() {
|
||||
if c == '.' || c == 'e' || c == 'E' {
|
||||
return self.n.parse::<f64>().ok().map_or(false, |f| f.is_finite());
|
||||
return self.n.parse::<f64>().ok().map_or(false, f64::is_finite);
|
||||
}
|
||||
}
|
||||
false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user