Use DoubleEndedIterator instead of collect to Vec for reversing
Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
This commit is contained in:
parent
dd2f74794a
commit
0637691eb1
2 changed files with 1 additions and 3 deletions
|
@ -3076,8 +3076,6 @@ fn goto_prev_diag(cx: &mut Context) {
|
|||
|
||||
let diag = doc
|
||||
.shown_diagnostics()
|
||||
.collect::<Vec<_>>()
|
||||
.into_iter()
|
||||
.rev()
|
||||
.find(|diag| diag.range.start < cursor_pos)
|
||||
.or_else(|| doc.shown_diagnostics().last());
|
||||
|
|
|
@ -1607,7 +1607,7 @@ impl Document {
|
|||
&self.diagnostics
|
||||
}
|
||||
|
||||
pub fn shown_diagnostics(&self) -> impl Iterator<Item = &Diagnostic> {
|
||||
pub fn shown_diagnostics(&self) -> impl Iterator<Item = &Diagnostic> + DoubleEndedIterator {
|
||||
let ls_ids: HashSet<_> = self
|
||||
.language_servers_with_feature(LanguageServerFeature::Diagnostics)
|
||||
.iter()
|
||||
|
|
Loading…
Reference in a new issue