diff --git a/crates/common/src/file/workspace.rs b/crates/common/src/file/workspace.rs index f9b4e7b902..9f2c6495b7 100644 --- a/crates/common/src/file/workspace.rs +++ b/crates/common/src/file/workspace.rs @@ -75,10 +75,7 @@ impl Workspace { #[salsa::tracked] pub fn get_relative_path(self, db: &dyn InputDb, base: Url, file: File) -> Option { - let file_url = match self.paths(db).get(&file) { - Some(url) => url.clone(), - None => return None, - }; + let file_url = self.paths(db).get(&file)?.clone(); base.make_relative(&file_url).map(Utf8PathBuf::from) } diff --git a/crates/fe-web/src/model.rs b/crates/fe-web/src/model.rs index a549b06ce8..9523deaccb 100644 --- a/crates/fe-web/src/model.rs +++ b/crates/fe-web/src/model.rs @@ -717,7 +717,7 @@ impl DocIndex { // Look up the trait URL let trait_url = lookup_trait(&trait_items, &trait_impl.trait_name) .map(|p| format!("{}/trait", p)) - .unwrap_or_else(|| format!("{}/trait", &trait_impl.trait_name)); + .unwrap_or_else(|| format!("{}/trait", trait_impl.trait_name)); // Use the target item's path and kind for the type URL let type_url = format!("{}/{}", item.path, item.kind.as_str()); diff --git a/crates/fe/src/abi.rs b/crates/fe/src/abi.rs index 628a47483a..1afc435e35 100644 --- a/crates/fe/src/abi.rs +++ b/crates/fe/src/abi.rs @@ -881,10 +881,9 @@ fn std_sol_compat_abi_type( // Match Uint{N} or Int{N} where N is a valid Solidity bit width (8..=256, multiple of 8) let (prefix, digits) = if let Some(rest) = name.strip_prefix("Uint") { ("uint", rest) - } else if let Some(rest) = name.strip_prefix("Int") { - ("int", rest) } else { - return None; + let rest = name.strip_prefix("Int")?; + ("int", rest) }; let bits: u16 = digits.parse().ok()?; diff --git a/crates/hir/src/analysis/semantic/borrowck/noesc.rs b/crates/hir/src/analysis/semantic/borrowck/noesc.rs index dc8cfb6419..2eef58ac40 100644 --- a/crates/hir/src/analysis/semantic/borrowck/noesc.rs +++ b/crates/hir/src/analysis/semantic/borrowck/noesc.rs @@ -77,13 +77,7 @@ impl<'db> NoEsc<'db> { ) -> Result<(), SemanticBorrowDiagnostic<'db>> { match &stmt.kind { NSStmtKind::Assign { - expr: - NExpr::Call { - callee, - args, - effect_args: _, - .. - }, + expr: NExpr::Call { callee, args, .. }, .. } => self.check_call_args(state, stmt.origin, *callee, args), NSStmtKind::Store { dst, src } => self.check_store(state, stmt.origin, dst, *src), diff --git a/crates/hir/src/analysis/semantic/borrowck/verify.rs b/crates/hir/src/analysis/semantic/borrowck/verify.rs index bd8e749e38..9048b1729c 100644 --- a/crates/hir/src/analysis/semantic/borrowck/verify.rs +++ b/crates/hir/src/analysis/semantic/borrowck/verify.rs @@ -67,7 +67,7 @@ pub fn verify_normalized_semantic_body<'db>( "normalized local {} has mismatched interface/lowering: {:?} vs {:?}", local_id.index(), local.facts.interface, - &local.lowering, + local.lowering, ), )); } diff --git a/crates/mir/src/runtime/lower/body.rs b/crates/mir/src/runtime/lower/body.rs index 784054f67f..9d52173d54 100644 --- a/crates/mir/src/runtime/lower/body.rs +++ b/crates/mir/src/runtime/lower/body.rs @@ -150,13 +150,7 @@ fn check_runtime_body_supported<'db>( for block in &body.blocks { for stmt in &block.stmts { if let NSStmtKind::Assign { - expr: - NExpr::Call { - callee, - args, - effect_args: _, - .. - }, + expr: NExpr::Call { callee, args, .. }, .. } = &stmt.kind && let Some(value_ty) = panic_payload_ty(db, body, *callee, args)