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"