From 1d6eef1350ee0793fcd2a0eb191cdb127b76a49d Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 11 Jun 2021 18:12:51 +0200 Subject: Update ungrammar --- crates/ide/src/hover.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ide') diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index ed4f18e1f..1c6d36939 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -208,7 +208,7 @@ pub(crate) fn hover( } fn try_hover_for_attribute(token: &SyntaxToken) -> Option> { - let attr = token.ancestors().nth(1).and_then(ast::Attr::cast)?; + let attr = token.ancestors().find_map(ast::Attr::cast)?; let (path, tt) = attr.as_simple_call()?; if !tt.syntax().text_range().contains(token.text_range().start()) { return None; -- cgit v1.2.3