Skip to content

Commit

Permalink
Clean
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuichiueda committed Oct 21, 2024
1 parent 625f420 commit cfb4844
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/elements/subword/braced_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,16 @@ impl BracedParam {
return false;
}

match offset.eval(core) {
let num_str = match offset.eval(core) {
None => return false,
Some(s) => match s.parse::<usize>() {
Ok(n) => {
self.text = self.text.chars().enumerate().filter(|(i, _)| i >= &n).map(|(_, c)| c).collect();
},
_ => return false,
}
Some(s) => s,
};

match num_str.parse::<usize>() {
Ok(n) => self.text = self.text.chars().enumerate()
.filter(|(i, _)| i >= &n)
.map(|(_, c)| c).collect(),
_ => return false,
}
true
}
Expand Down

0 comments on commit cfb4844

Please sign in to comment.