Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
cryshado committed Aug 26, 2023
1 parent 826f304 commit b3f766a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/modules/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,12 @@ impl FiftModule for BaseModule {
let idx = stack.pop_usize()?;
let value = stack.pop()?;
let mut tuple = stack.pop_tuple()?;

let l = tuple.len();
anyhow::ensure!(idx <= l, format!("insertion index (is {idx}) should be <= len (is {l})"));
anyhow::ensure!(
idx <= l,
format!("insertion index (is {idx}) should be <= len (is {l})")
);

Rc::make_mut(&mut tuple).insert(idx, value);
stack.push_raw(tuple)
Expand Down

0 comments on commit b3f766a

Please sign in to comment.