diff options
author | succcubbus <[email protected]> | 2019-12-13 18:54:02 +0000 |
---|---|---|
committer | succcubbus <[email protected]> | 2019-12-13 18:54:02 +0000 |
commit | f54fef85aa88db44b1d3f6436551595dcb98ab83 (patch) | |
tree | 78185e666ee9888103eeb6e29569b04e83c3acaf /crates | |
parent | 4df741ecb2d00c3d8cdbc37d734ff5514dd5e7b0 (diff) |
use find() instead of filter().next()
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_ide/src/hover.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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( | |||
156 | 156 | ||
157 | pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeInfo<HoverResult>> { | 157 | pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeInfo<HoverResult>> { |
158 | let file = db.parse_or_expand(position.file_id.into())?; | 158 | let file = db.parse_or_expand(position.file_id.into())?; |
159 | let token = file.token_at_offset(position.offset).filter(|it| !it.kind().is_trivia()).next()?; | 159 | let token = file.token_at_offset(position.offset).find(|it| !it.kind().is_trivia())?; |
160 | let token = descend_into_macros(db, position.file_id, token); | 160 | let token = descend_into_macros(db, position.file_id, token); |
161 | 161 | ||
162 | let mut res = HoverResult::new(); | 162 | let mut res = HoverResult::new(); |