From fe024713da3869a5f1b0fbd4e9a1a548e560b4e8 Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Wed, 25 Nov 2026 21:39:51 +0800 Subject: [PATCH] fix(java): take the last diagnostic line with next_back (#5909) lines.last() on the double-ended filter iterator tripped clippy::double_ended_iterator_last, failing the Rust checks on main; next_back() returns the same line. --- crates/ide-lsp/src/jdtls.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ide-lsp/src/jdtls.rs b/crates/ide-lsp/src/jdtls.rs index 3eea9d148..a81c10a64 100644 --- a/crates/ide-lsp/src/jdtls.rs +++ b/crates/ide-lsp/src/jdtls.rs @@ -357,7 +357,7 @@ const GRADLE_TOOLING_FAILURES: [&str; 4] = [ fn launch_message(message: &str) -> String { let mut lines = message.lines().map(str::trim).filter(|l| !l.is_empty()); let first = lines.next().unwrap_or_default(); - match lines.last() { + match lines.next_back() { Some(cause) if GRADLE_TOOLING_FAILURES.iter().any(|m| first.contains(m)) => format!("{first} Cause: {cause}"), _ => first.to_owned(), }