mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-30 01:43:54 +00:00
Merge pull request #3834 from roc-lang/rust-1.63-clippy
rust 1.63 clippy
This commit is contained in:
commit
3ca9202e3b
10 changed files with 14 additions and 19 deletions
|
@ -293,7 +293,7 @@ fn chomp_accessor(buffer: &[u8], pos: Position) -> Result<&str, BadIdent> {
|
|||
/// a `@Token` opaque
|
||||
fn chomp_opaque_ref(buffer: &[u8], pos: Position) -> Result<&str, BadIdent> {
|
||||
// assumes the leading `@` has NOT been chomped already
|
||||
debug_assert_eq!(buffer.get(0), Some(&b'@'));
|
||||
debug_assert_eq!(buffer.first(), Some(&b'@'));
|
||||
use encode_unicode::CharExt;
|
||||
|
||||
let bad_ident = BadIdent::BadOpaqueRef;
|
||||
|
|
|
@ -14,7 +14,7 @@ pub enum NumLiteral<'a> {
|
|||
|
||||
pub fn positive_number_literal<'a>() -> impl Parser<'a, NumLiteral<'a>, ENumber> {
|
||||
move |_arena, state: State<'a>| {
|
||||
match state.bytes().get(0) {
|
||||
match state.bytes().first() {
|
||||
Some(first_byte) if (*first_byte as char).is_ascii_digit() => {
|
||||
parse_number_base(false, state.bytes(), state)
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ pub fn positive_number_literal<'a>() -> impl Parser<'a, NumLiteral<'a>, ENumber>
|
|||
|
||||
pub fn number_literal<'a>() -> impl Parser<'a, NumLiteral<'a>, ENumber> {
|
||||
move |_arena, state: State<'a>| {
|
||||
match state.bytes().get(0) {
|
||||
match state.bytes().first() {
|
||||
Some(first_byte) if *first_byte == b'-' => {
|
||||
// drop the minus
|
||||
parse_number_base(true, &state.bytes()[1..], state)
|
||||
|
@ -92,7 +92,7 @@ fn chomp_number_dec<'a>(
|
|||
return Err((Progress::NoProgress, ENumber::End, state));
|
||||
}
|
||||
|
||||
if !bytes.get(0).copied().unwrap_or_default().is_ascii_digit() {
|
||||
if !bytes.first().copied().unwrap_or_default().is_ascii_digit() {
|
||||
// we're probably actually looking at unary negation here
|
||||
return Err((Progress::NoProgress, ENumber::End, state));
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ fn chomp_number(mut bytes: &[u8]) -> (bool, usize) {
|
|||
let start_bytes_len = bytes.len();
|
||||
let mut is_float = false;
|
||||
|
||||
while let Some(byte) = bytes.get(0) {
|
||||
while let Some(byte) = bytes.first() {
|
||||
match byte {
|
||||
b'.' => {
|
||||
// skip, fix multiple `.`s in canonicalization
|
||||
|
|
|
@ -1441,7 +1441,7 @@ where
|
|||
{
|
||||
debug_assert_ne!(word, b'\n');
|
||||
|
||||
move |_arena: &'a Bump, state: State<'a>| match state.bytes().get(0) {
|
||||
move |_arena: &'a Bump, state: State<'a>| match state.bytes().first() {
|
||||
Some(x) if *x == word => {
|
||||
let state = state.advance(1);
|
||||
Ok((MadeProgress, (), state))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue