Skip to content

Commit 30ee511

Browse files
committed
style: standardize imports
1 parent f20127b commit 30ee511

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

crates/lint/src/sol/med/unsafe_typecast.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ use crate::{
33
linter::{LateLintPass, LintContext, Snippet},
44
sol::{Severity, SolLint},
55
};
6-
use solar_sema::hir::{self, ExprKind, TypeKind};
6+
use solar_ast::{LitKind, StrKind};
7+
use solar_sema::hir::{self, ElementaryType, ExprKind, ItemId, Res, TypeKind};
78

89
declare_forge_lint!(
910
UNSAFE_TYPECAST,
@@ -59,10 +60,7 @@ fn is_unsafe_typecast_hir(
5960

6061
/// Infers the elementary type of a source expression.
6162
/// For cast chains, returns the ultimate source type, not intermediate cast results.
62-
fn infer_source_type(hir: &hir::Hir<'_>, expr: &hir::Expr<'_>) -> Option<hir::ElementaryType> {
63-
use hir::{ElementaryType, ItemId, Lit as HirLit, Res};
64-
use solar_ast::LitKind;
65-
63+
fn infer_source_type(hir: &hir::Hir<'_>, expr: &hir::Expr<'_>) -> Option<ElementaryType> {
6664
match &expr.kind {
6765
// Recursive cast: Type(val)
6866
ExprKind::Call(call_expr, args, _) => {
@@ -114,11 +112,9 @@ fn infer_source_type(hir: &hir::Hir<'_>, expr: &hir::Expr<'_>) -> Option<hir::El
114112

115113
/// Checks if a type cast from source_type to target_type is unsafe.
116114
fn is_unsafe_elementary_typecast(
117-
source_type: &hir::ElementaryType,
118-
target_type: &hir::ElementaryType,
115+
source_type: &ElementaryType,
116+
target_type: &ElementaryType,
119117
) -> bool {
120-
use hir::ElementaryType;
121-
122118
match (source_type, target_type) {
123119
// Numeric downcasts (smaller target size)
124120
(ElementaryType::UInt(source_size), ElementaryType::UInt(target_size))

0 commit comments

Comments
 (0)