Skip to content

Commit 54b1b78

Browse files
committed
Remove needless unwrap
1 parent 9659474 commit 54b1b78

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tokenizers/src/models/bpe/trainer.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,10 @@ impl BpeTrainer {
459459
break;
460460
}
461461

462-
if queue.is_empty() {
462+
let Some(mut top) = queue.pop() else {
463463
break;
464-
}
464+
};
465465

466-
let mut top = queue.pop().unwrap();
467466
if top.count != pair_counts[&top.pair] as u64 {
468467
top.count = pair_counts[&top.pair] as u64;
469468
queue.push(top);

0 commit comments

Comments
 (0)