cargo fmt AGAIN

This commit is contained in:
Chelsea Troy 2021-12-01 23:59:58 -06:00
parent b65a69f07e
commit e57a539a66
2 changed files with 11 additions and 13 deletions

2
cli_utils/Cargo.lock generated
View file

@ -2656,6 +2656,7 @@ dependencies = [
"roc_mono", "roc_mono",
"roc_problem", "roc_problem",
"roc_region", "roc_region",
"roc_reporting",
"roc_solve", "roc_solve",
"roc_types", "roc_types",
"roc_unify", "roc_unify",
@ -2818,6 +2819,7 @@ dependencies = [
name = "roc_solve" name = "roc_solve"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"arrayvec 0.7.2",
"bumpalo", "bumpalo",
"roc_can", "roc_can",
"roc_collections", "roc_collections",

View file

@ -66,17 +66,15 @@ pub fn parse_single_quote<'a>() -> impl Parser<'a, &'a str, EString<'a>> {
match state.bytes.first() { match state.bytes.first() {
Some(&ch) => { Some(&ch) => {
state = advance_state!(state, 1)?; state = advance_state!(state, 1)?;
if (ch == b'n' || ch == b'r' || ch == b't' || ch == b'\'' || ch == b'\\') && (state.bytes.first() == Some(&b'\'')) { if (ch == b'n' || ch == b'r' || ch == b't' || ch == b'\'' || ch == b'\\')
&& (state.bytes.first() == Some(&b'\''))
{
state = advance_state!(state, 1)?; state = advance_state!(state, 1)?;
// since we checked the current char between the single quotes we // since we checked the current char between the single quotes we
// know they are valid UTF-8, allowing us to use 'from_u32_unchecked' // know they are valid UTF-8, allowing us to use 'from_u32_unchecked'
let test = unsafe { char::from_u32_unchecked(ch as u32) }; let test = unsafe { char::from_u32_unchecked(ch as u32) };
return Ok(( return Ok((MadeProgress, &*arena.alloc_str(&test.to_string()), state));
MadeProgress,
&*arena.alloc_str(&test.to_string()),
state,
));
} }
// invalid error, backslah escaping something we do not recognize // invalid error, backslah escaping something we do not recognize
return Err(( return Err((
@ -142,9 +140,7 @@ pub fn parse_single_quote<'a>() -> impl Parser<'a, &'a str, EString<'a>> {
state = advance_state!(state, end_index)?; state = advance_state!(state, end_index)?;
match std::str::from_utf8(raw_bytes) { match std::str::from_utf8(raw_bytes) {
Ok(string) => { Ok(string) => Ok((MadeProgress, string, state)),
Ok((MadeProgress, string, state))
}
Err(_) => { Err(_) => {
// invalid UTF-8 // invalid UTF-8
return Err(( return Err((