From c3bcd5c8422b79bd5cbc874a98f70cdb92e8d445 Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Fri, 6 Sep 2024 15:09:09 +0200 Subject: [PATCH] Upgrade to Rust 1.81 (#13265) --- .../ruff_linter/src/rules/pydocstyle/rules/triple_quotes.rs | 4 +--- crates/ruff_python_parser/src/string.rs | 3 +-- rust-toolchain.toml | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/ruff_linter/src/rules/pydocstyle/rules/triple_quotes.rs b/crates/ruff_linter/src/rules/pydocstyle/rules/triple_quotes.rs index 5109c8b86303f..6504771099fef 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/rules/triple_quotes.rs +++ b/crates/ruff_linter/src/rules/pydocstyle/rules/triple_quotes.rs @@ -67,9 +67,7 @@ impl Violation for TripleSingleQuotes { pub(crate) fn triple_quotes(checker: &mut Checker, docstring: &Docstring) { let leading_quote = docstring.leading_quote(); - let prefixes = leading_quote - .trim_end_matches(|c| c == '\'' || c == '"') - .to_owned(); + let prefixes = leading_quote.trim_end_matches(['\'', '"']).to_owned(); let expected_quote = if docstring.body().contains("\"\"\"") { if docstring.body().contains("\'\'\'") { diff --git a/crates/ruff_python_parser/src/string.rs b/crates/ruff_python_parser/src/string.rs index 8c9d61ba91b79..e2b08d1c078d5 100644 --- a/crates/ruff_python_parser/src/string.rs +++ b/crates/ruff_python_parser/src/string.rs @@ -97,9 +97,8 @@ impl StringParser { #[inline] fn next_char(&mut self) -> Option { - self.source[self.cursor..].chars().next().map(|c| { + self.source[self.cursor..].chars().next().inspect(|c| { self.cursor += c.len_utf8(); - c }) } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 8cca5be0594d4..4cef0b738ff63 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.80" +channel = "1.81"