Skip to content

Commit 745e563

Browse files
authored
clippy 1.97 (#1517)
1 parent d1ee9eb commit 745e563

6 files changed

Lines changed: 7 additions & 23 deletions

File tree

crates/common/src/file/workspace.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ impl Workspace {
7575

7676
#[salsa::tracked]
7777
pub fn get_relative_path(self, db: &dyn InputDb, base: Url, file: File) -> Option<Utf8PathBuf> {
78-
let file_url = match self.paths(db).get(&file) {
79-
Some(url) => url.clone(),
80-
None => return None,
81-
};
78+
let file_url = self.paths(db).get(&file)?.clone();
8279
base.make_relative(&file_url).map(Utf8PathBuf::from)
8380
}
8481

crates/fe-web/src/model.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ impl DocIndex {
717717
// Look up the trait URL
718718
let trait_url = lookup_trait(&trait_items, &trait_impl.trait_name)
719719
.map(|p| format!("{}/trait", p))
720-
.unwrap_or_else(|| format!("{}/trait", &trait_impl.trait_name));
720+
.unwrap_or_else(|| format!("{}/trait", trait_impl.trait_name));
721721

722722
// Use the target item's path and kind for the type URL
723723
let type_url = format!("{}/{}", item.path, item.kind.as_str());

crates/fe/src/abi.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,10 +881,9 @@ fn std_sol_compat_abi_type(
881881
// Match Uint{N} or Int{N} where N is a valid Solidity bit width (8..=256, multiple of 8)
882882
let (prefix, digits) = if let Some(rest) = name.strip_prefix("Uint") {
883883
("uint", rest)
884-
} else if let Some(rest) = name.strip_prefix("Int") {
885-
("int", rest)
886884
} else {
887-
return None;
885+
let rest = name.strip_prefix("Int")?;
886+
("int", rest)
888887
};
889888

890889
let bits: u16 = digits.parse().ok()?;

crates/hir/src/analysis/semantic/borrowck/noesc.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,7 @@ impl<'db> NoEsc<'db> {
7777
) -> Result<(), SemanticBorrowDiagnostic<'db>> {
7878
match &stmt.kind {
7979
NSStmtKind::Assign {
80-
expr:
81-
NExpr::Call {
82-
callee,
83-
args,
84-
effect_args: _,
85-
..
86-
},
80+
expr: NExpr::Call { callee, args, .. },
8781
..
8882
} => self.check_call_args(state, stmt.origin, *callee, args),
8983
NSStmtKind::Store { dst, src } => self.check_store(state, stmt.origin, dst, *src),

crates/hir/src/analysis/semantic/borrowck/verify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub fn verify_normalized_semantic_body<'db>(
6767
"normalized local {} has mismatched interface/lowering: {:?} vs {:?}",
6868
local_id.index(),
6969
local.facts.interface,
70-
&local.lowering,
70+
local.lowering,
7171
),
7272
));
7373
}

crates/mir/src/runtime/lower/body.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,7 @@ fn check_runtime_body_supported<'db>(
150150
for block in &body.blocks {
151151
for stmt in &block.stmts {
152152
if let NSStmtKind::Assign {
153-
expr:
154-
NExpr::Call {
155-
callee,
156-
args,
157-
effect_args: _,
158-
..
159-
},
153+
expr: NExpr::Call { callee, args, .. },
160154
..
161155
} = &stmt.kind
162156
&& let Some(value_ty) = panic_payload_ty(db, body, *callee, args)

0 commit comments

Comments
 (0)