Found another bug where identical cut pieces cause a subtract overflow error. You can run the test without the lib.rs change to see the problem in action. I'm not sure exactly what's going on but when I debug somehow cut_piece.quantity can reach Some(0) and still iterate.
This is the error:
attempt to subtract with overflow thread 'tests::guillotine_stock_duplicate_cut_piece' panicked at 'attempt to subtract with overflow', src/lib.rs:242:13
Found another bug where identical cut pieces cause a subtract overflow error. You can run the test without the lib.rs change to see the problem in action. I'm not sure exactly what's going on but when I debug somehow cut_piece.quantity can reach Some(0) and still iterate.
This is the error:
attempt to subtract with overflow thread 'tests::guillotine_stock_duplicate_cut_piece' panicked at 'attempt to subtract with overflow', src/lib.rs:242:13