unnecessary_cast

This commit is contained in:
Johann Hemmann 2024-01-22 01:00:50 +01:00
parent daa20725c5
commit de6f9561f2
3 changed files with 4 additions and 5 deletions

View file

@ -181,7 +181,6 @@ non_canonical_partial_ord_impl = "allow"
self_named_constructors = "allow" self_named_constructors = "allow"
too_many_arguments = "allow" too_many_arguments = "allow"
type_complexity = "allow" type_complexity = "allow"
unnecessary_cast = "allow"
unnecessary_filter_map = "allow" unnecessary_filter_map = "allow"
unnecessary_lazy_evaluations = "allow" unnecessary_lazy_evaluations = "allow"
unnecessary_mut_passed = "allow" unnecessary_mut_passed = "allow"

View file

@ -297,7 +297,7 @@ impl SearchMode {
SearchMode::Exact => candidate.eq_ignore_ascii_case(query), SearchMode::Exact => candidate.eq_ignore_ascii_case(query),
SearchMode::Prefix => { SearchMode::Prefix => {
query.len() <= candidate.len() && { query.len() <= candidate.len() && {
let prefix = &candidate[..query.len() as usize]; let prefix = &candidate[..query.len()];
if case_sensitive { if case_sensitive {
prefix == query prefix == query
} else { } else {
@ -446,7 +446,7 @@ fn search_maps(
let end = (value & 0xFFFF_FFFF) as usize; let end = (value & 0xFFFF_FFFF) as usize;
let start = (value >> 32) as usize; let start = (value >> 32) as usize;
let ImportMap { item_to_info_map, importables, .. } = &*import_maps[import_map_idx]; 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 let iter = importables
.iter() .iter()

View file

@ -903,7 +903,7 @@ fn emit_def_diagnostic_(
} }
DefDiagnosticKind::InvalidDeriveTarget { ast, id } => { DefDiagnosticKind::InvalidDeriveTarget { ast, id } => {
let node = ast.to_node(db.upcast()); let node = ast.to_node(db.upcast());
let derive = node.attrs().nth(*id as usize); let derive = node.attrs().nth(*id);
match derive { match derive {
Some(derive) => { Some(derive) => {
acc.push( acc.push(
@ -918,7 +918,7 @@ fn emit_def_diagnostic_(
} }
DefDiagnosticKind::MalformedDerive { ast, id } => { DefDiagnosticKind::MalformedDerive { ast, id } => {
let node = ast.to_node(db.upcast()); let node = ast.to_node(db.upcast());
let derive = node.attrs().nth(*id as usize); let derive = node.attrs().nth(*id);
match derive { match derive {
Some(derive) => { Some(derive) => {
acc.push( acc.push(