Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions crates/common/src/file/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ impl Workspace {

#[salsa::tracked]
pub fn get_relative_path(self, db: &dyn InputDb, base: Url, file: File) -> Option<Utf8PathBuf> {
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)
}

Expand Down
2 changes: 1 addition & 1 deletion crates/fe-web/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
5 changes: 2 additions & 3 deletions crates/fe/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;
Expand Down
8 changes: 1 addition & 7 deletions crates/hir/src/analysis/semantic/borrowck/noesc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion crates/hir/src/analysis/semantic/borrowck/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
));
}
Expand Down
8 changes: 1 addition & 7 deletions crates/mir/src/runtime/lower/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading