Use TryConv for conversion

This commit is contained in:
DJMcNab 2018-12-31 12:17:05 +00:00
parent 79941a9e70
commit be75e547ce

View File

@ -678,11 +678,10 @@ pub fn handle_document_highlight(
) -> Result<Option<Vec<DocumentHighlight>>> {
let file_id = params.text_document.try_conv_with(&world)?;
let line_index = world.analysis().file_line_index(file_id);
let offset = params.position.conv_with(&line_index);
let refs = world
.analysis()
.find_all_refs(FilePosition { file_id, offset })?;
.find_all_refs(params.try_conv_with(&world)?)?;
Ok(Some(
refs.into_iter()