mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
clippy: cast_lossless
This commit is contained in:
parent
a5da770ec6
commit
6dd3fa6a94
1 changed files with 2 additions and 2 deletions
|
@ -65,7 +65,7 @@ impl ConvWith for TextUnit {
|
||||||
fn conv_with(self, line_index: &LineIndex) -> Position {
|
fn conv_with(self, line_index: &LineIndex) -> Position {
|
||||||
let line_col = line_index.line_col(self);
|
let line_col = line_index.line_col(self);
|
||||||
// TODO: UTF-16
|
// 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())
|
.map(|it| it.edits.as_slice())
|
||||||
.unwrap_or(&[]);
|
.unwrap_or(&[]);
|
||||||
let line_col = translate_offset_with_edit(&*line_index, pos.offset, edits);
|
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 {
|
Some(TextDocumentPositionParams {
|
||||||
text_document: TextDocumentIdentifier::new(pos.file_id.try_conv_with(world)?),
|
text_document: TextDocumentIdentifier::new(pos.file_id.try_conv_with(world)?),
|
||||||
position,
|
position,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue