mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +00:00
update with new clippy lints
This commit is contained in:
parent
51b360b578
commit
0dd2cec09a
22 changed files with 53 additions and 77 deletions
|
@ -166,8 +166,7 @@ fn sort_type_defs_before_introduction(
|
|||
Ok(result) => result
|
||||
.iter()
|
||||
.rev()
|
||||
.map(|group_index| sccs[*group_index].iter())
|
||||
.flatten()
|
||||
.flat_map(|group_index| sccs[*group_index].iter())
|
||||
.copied()
|
||||
.collect(),
|
||||
|
||||
|
|
|
@ -281,8 +281,7 @@ pub fn canonicalize_module_defs<'a>(
|
|||
let transitive_builtins: Vec<Symbol> = referenced_values
|
||||
.iter()
|
||||
.filter(|s| s.is_builtin())
|
||||
.map(|s| crate::builtins::builtin_dependencies(*s))
|
||||
.flatten()
|
||||
.flat_map(|s| crate::builtins::builtin_dependencies(*s))
|
||||
.copied()
|
||||
.collect();
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ pub enum ParsedNumResult {
|
|||
pub fn finish_parsing_num(raw: &str) -> Result<ParsedNumResult, (&str, IntErrorKind)> {
|
||||
// Ignore underscores.
|
||||
let radix = 10;
|
||||
from_str_radix(raw.replace("_", "").as_str(), radix).map_err(|e| (raw, e))
|
||||
from_str_radix(raw.replace('_', "").as_str(), radix).map_err(|e| (raw, e))
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
@ -128,9 +128,9 @@ pub fn finish_parsing_base(
|
|||
|
||||
// Ignore underscores, insert - when negative to get correct underflow/overflow behavior
|
||||
(if is_negative {
|
||||
from_str_radix(format!("-{}", raw.replace("_", "")).as_str(), radix)
|
||||
from_str_radix(format!("-{}", raw.replace('_', "")).as_str(), radix)
|
||||
} else {
|
||||
from_str_radix(raw.replace("_", "").as_str(), radix)
|
||||
from_str_radix(raw.replace('_', "").as_str(), radix)
|
||||
})
|
||||
.and_then(|parsed| match parsed {
|
||||
ParsedNumResult::Float(..) => Err(IntErrorKind::FloatSuffix),
|
||||
|
@ -154,7 +154,7 @@ pub fn finish_parsing_float(raw: &str) -> Result<(f64, FloatBound), (&str, Float
|
|||
};
|
||||
|
||||
// Ignore underscores.
|
||||
match raw_without_suffix.replace("_", "").parse::<f64>() {
|
||||
match raw_without_suffix.replace('_', "").parse::<f64>() {
|
||||
Ok(float) if float.is_finite() => Ok((float, bound)),
|
||||
Ok(float) => {
|
||||
if float.is_sign_positive() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue