mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Run linter
This commit is contained in:
parent
f7a055fc78
commit
9f72b2710f
9 changed files with 66 additions and 32 deletions
|
|
@ -515,20 +515,20 @@ fn numeric_negate_expression<'a, T>(
|
|||
let start = state.pos();
|
||||
let region = Region::new(start, expr.region.end());
|
||||
|
||||
let new_expr = match &expr.value {
|
||||
&Expr::Num(string, bound) => {
|
||||
let new_expr = match expr.value {
|
||||
Expr::Num(string, bound) => {
|
||||
let new_string =
|
||||
unsafe { std::str::from_utf8_unchecked(&state.bytes()[..string.len() + 1]) };
|
||||
|
||||
Expr::Num(new_string, bound)
|
||||
}
|
||||
&Expr::Float(string, bound) => {
|
||||
Expr::Float(string, bound) => {
|
||||
let new_string =
|
||||
unsafe { std::str::from_utf8_unchecked(&state.bytes()[..string.len() + 1]) };
|
||||
|
||||
Expr::Float(new_string, bound)
|
||||
}
|
||||
&Expr::NonBase10Int {
|
||||
Expr::NonBase10Int {
|
||||
string,
|
||||
base,
|
||||
is_negative,
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ macro_rules! parse_num_suffix {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_int_suffix<'a>(bytes: &'a [u8]) -> Option<(IntWidth, usize)> {
|
||||
fn get_int_suffix(bytes: &[u8]) -> Option<(IntWidth, usize)> {
|
||||
parse_num_suffix! {
|
||||
bytes,
|
||||
b"u8", IntWidth::U8
|
||||
|
|
@ -97,7 +97,7 @@ fn get_int_suffix<'a>(bytes: &'a [u8]) -> Option<(IntWidth, usize)> {
|
|||
None
|
||||
}
|
||||
|
||||
fn get_float_suffix<'a>(bytes: &'a [u8]) -> Option<(FloatWidth, usize)> {
|
||||
fn get_float_suffix(bytes: &[u8]) -> Option<(FloatWidth, usize)> {
|
||||
parse_num_suffix! {
|
||||
bytes,
|
||||
b"dec", FloatWidth::Dec
|
||||
|
|
@ -107,7 +107,7 @@ fn get_float_suffix<'a>(bytes: &'a [u8]) -> Option<(FloatWidth, usize)> {
|
|||
None
|
||||
}
|
||||
|
||||
fn get_num_suffix<'a>(bytes: &'a [u8]) -> Option<(NumWidth, usize)> {
|
||||
fn get_num_suffix(bytes: &[u8]) -> Option<(NumWidth, usize)> {
|
||||
(get_int_suffix(bytes).map(|(iw, l)| (NumWidth::Int(iw), l)))
|
||||
.or_else(|| get_float_suffix(bytes).map(|(fw, l)| (NumWidth::Float(fw), l)))
|
||||
}
|
||||
|
|
@ -205,6 +205,7 @@ fn chomp_number_dec<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
fn chomp_number<'a>(
|
||||
mut bytes: &'a [u8],
|
||||
state: State<'a>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue