Skip to content

Commit

Permalink
feat: Change to wrapping add
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmah309 committed Dec 17, 2024
1 parent 36046ce commit db3a874
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions impl/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,18 +539,15 @@ fn extract_cfg(attributes: Vec<Attribute>) -> (Vec<Attribute>, Vec<Attribute>) {
}

let mut cfgs = Vec::new();
// let mut index: usize = usize::MAX;
let mut index = 0;
let mut index: usize = usize::MAX;
let attributes = attributes
.into_iter()
.filter_map(|e| {
// index = index.wrapping_add(1);
index = index.wrapping_add(1);
if to_remove.contains(&index) {
index += 1;
cfgs.push(e);
return None;
}
index += 1;
Some(e)
})
.collect::<Vec<_>>();
Expand Down

0 comments on commit db3a874

Please sign in to comment.