mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
unnecessary_cast
This commit is contained in:
parent
daa20725c5
commit
de6f9561f2
3 changed files with 4 additions and 5 deletions
|
@ -181,7 +181,6 @@ non_canonical_partial_ord_impl = "allow"
|
|||
self_named_constructors = "allow"
|
||||
too_many_arguments = "allow"
|
||||
type_complexity = "allow"
|
||||
unnecessary_cast = "allow"
|
||||
unnecessary_filter_map = "allow"
|
||||
unnecessary_lazy_evaluations = "allow"
|
||||
unnecessary_mut_passed = "allow"
|
||||
|
|
|
@ -297,7 +297,7 @@ impl SearchMode {
|
|||
SearchMode::Exact => candidate.eq_ignore_ascii_case(query),
|
||||
SearchMode::Prefix => {
|
||||
query.len() <= candidate.len() && {
|
||||
let prefix = &candidate[..query.len() as usize];
|
||||
let prefix = &candidate[..query.len()];
|
||||
if case_sensitive {
|
||||
prefix == query
|
||||
} else {
|
||||
|
@ -446,7 +446,7 @@ fn search_maps(
|
|||
let end = (value & 0xFFFF_FFFF) as usize;
|
||||
let start = (value >> 32) as usize;
|
||||
let ImportMap { item_to_info_map, importables, .. } = &*import_maps[import_map_idx];
|
||||
let importables = &importables[start as usize..end];
|
||||
let importables = &importables[start..end];
|
||||
|
||||
let iter = importables
|
||||
.iter()
|
||||
|
|
|
@ -903,7 +903,7 @@ fn emit_def_diagnostic_(
|
|||
}
|
||||
DefDiagnosticKind::InvalidDeriveTarget { ast, id } => {
|
||||
let node = ast.to_node(db.upcast());
|
||||
let derive = node.attrs().nth(*id as usize);
|
||||
let derive = node.attrs().nth(*id);
|
||||
match derive {
|
||||
Some(derive) => {
|
||||
acc.push(
|
||||
|
@ -918,7 +918,7 @@ fn emit_def_diagnostic_(
|
|||
}
|
||||
DefDiagnosticKind::MalformedDerive { ast, id } => {
|
||||
let node = ast.to_node(db.upcast());
|
||||
let derive = node.attrs().nth(*id as usize);
|
||||
let derive = node.attrs().nth(*id);
|
||||
match derive {
|
||||
Some(derive) => {
|
||||
acc.push(
|
||||
|
|
Loading…
Reference in a new issue