Skip to content

Commit

Permalink
Fixed linting error
Browse files Browse the repository at this point in the history
+ Use unwrap_or_else instead of expect
  • Loading branch information
lorenzorota committed Feb 11, 2025
1 parent ea55e94 commit c7be834
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/front/zsharp/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl T {
Ty::Struct(_, map) => Ok(FieldList::new(
map.fields()
.map(|(field, _)| {
let (idx, _) = map.search(field).expect(&format!("No field '{field}'"));
let (idx, _) = map.search(field).unwrap_or_else(|| panic!("{}", "No field '{field}'"));
(field.clone(), term![Op::Field(idx); self.term.clone()])
})
.collect(),
Expand All @@ -192,7 +192,7 @@ impl T {
.map(|(field, t)| {
let f_ty = fields
.search(field)
.expect(&format!("No field '{field}'"))
.unwrap_or_else(|| panic!("{}", "No field '{field}'"))
.1
.clone();

Expand Down

0 comments on commit c7be834

Please sign in to comment.