From 6dd3fa6a947a4442e46ac042ff955a7f17bd6a0f Mon Sep 17 00:00:00 2001 From: Alan Du Date: Wed, 17 Oct 2018 19:27:49 -0400 Subject: clippy: cast_lossless --- crates/ra_lsp_server/src/conv.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index 8325e8c1e..bc0cf7c68 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs @@ -65,7 +65,7 @@ impl ConvWith for TextUnit { fn conv_with(self, line_index: &LineIndex) -> Position { let line_col = line_index.line_col(self); // TODO: UTF-16 - Position::new(line_col.line as u64, u32::from(line_col.col) as u64) + Position::new(u64::from(line_col.line), u64::from(u32::from(line_col.col))) } } @@ -192,7 +192,7 @@ impl TryConvWith for SourceChange { .map(|it| it.edits.as_slice()) .unwrap_or(&[]); let line_col = translate_offset_with_edit(&*line_index, pos.offset, edits); - let position = Position::new(line_col.line as u64, u32::from(line_col.col) as u64); + let position = Position::new(u64::from(line_col.line), u64::from(u32::from(line_col.col))); Some(TextDocumentPositionParams { text_document: TextDocumentIdentifier::new(pos.file_id.try_conv_with(world)?), position, -- cgit v1.2.3