From f54fef85aa88db44b1d3f6436551595dcb98ab83 Mon Sep 17 00:00:00 2001 From: succcubbus <16743652+succcubbus@users.noreply.github.com> Date: Fri, 13 Dec 2019 19:54:02 +0100 Subject: use find() instead of filter().next() --- crates/ra_ide/src/hover.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index d372ca758..24f7eeed3 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -156,7 +156,7 @@ fn hover_text_from_name_kind( pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option> { let file = db.parse_or_expand(position.file_id.into())?; - let token = file.token_at_offset(position.offset).filter(|it| !it.kind().is_trivia()).next()?; + let token = file.token_at_offset(position.offset).find(|it| !it.kind().is_trivia())?; let token = descend_into_macros(db, position.file_id, token); let mut res = HoverResult::new(); -- cgit v1.2.3