1
1
mirror of https://github.com/oxalica/nil.git synced 2024-11-22 02:55:39 +03:00

Fix clippy warnings

This commit is contained in:
oxalica 2023-09-08 20:54:38 +08:00
parent 4bdcfcfe38
commit bd7e2e2de7
2 changed files with 8 additions and 5 deletions

View File

@ -148,7 +148,7 @@ regex_dfa! {
DQUOTE = r#"""#,
// Yes, we parse one UTF-8 encoded char here, to avoid break into code units.
// We can assume the input is already a valid UTF-8 string.
STRING_ESCAPE = r#"\\([\x00-\x7F]|[\x80-\xFF][\x80-\xBF]*)"#,
STRING_ESCAPE = r"\\([\x00-\x7F]|[\x80-\xFF][\x80-\xBF]*)",
DOLLAR_L_CURLY = r"\$\{",
// `$$` makes the second `$` loses the special meaning.
STRING_FRAGMENT = r"\$\$",
@ -161,7 +161,7 @@ regex_dfa! {
INDENT_STRING_TOKEN_DFA {
// The order matters!
// See comments in STRING_TOKEN_DFA's STRING_ESCAPE.
STRING_ESCAPE = r#"''\\([\x00-\x7F]|[\x80-\xFF][\x80-\xBF]*)|''\$|'''"#,
STRING_ESCAPE = r"''\\([\x00-\x7F]|[\x80-\xFF][\x80-\xBF]*)|''\$|'''",
QUOTE2 = r"''",
DOLLAR_L_CURLY = r"\$\{",
// `$$` makes the second `$` loses the special meaning.
@ -513,7 +513,7 @@ mod tests {
#[test]
fn indent_string() {
check_lex(
r#"'' a'''b$c''\nd''${e${{} ''f''} ''"#,
r"'' a'''b$c''\nd''${e${{} ''f''} ''",
expect![[r#"
QUOTE2 "''"
STRING_FRAGMENT " a"
@ -548,8 +548,8 @@ mod tests {
);
check_lex(
r#"''''\n''\_''\
''\ΣΣ''"#,
r"''''\n''\_''\
''\ΣΣ''",
expect![[r#"
QUOTE2 "''"
STRING_ESCAPE "''\\n"

View File

@ -70,6 +70,9 @@ rec {
"-D" "clippy::missing-panics-doc"
"-D" "clippy::semicolon_if_nothing_returned"
"-D" "clippy::uninlined_format_args"
# FIXME: https://github.com/rust-lang/rust-clippy/issues/11436
"-A" "clippy::missing_panics_doc"
];
pre-commit = pkgs.writeShellScriptBin "pre-commit" ''