ctm / mb2-doc

Mb2, poker software
https://devctm.com
7 stars 2 forks source link

Table::dup uses error-prone construct #1251

Closed ctm closed 9 months ago

ctm commented 9 months ago

Fix Table::dup to not use Rusts's struct update syntax.

Yesterday, when fixing the hang bug (#1249), my first fix failed becauseTable::dup duplicated the notify_tournament_of_finished_hand field rather than setting it to false. At the time, I simply fixed that field, but the problem is struct update syntax will duplicate any new field that's added to Table, even if it shouldn't be duplicated. So, I will remove the update dyntax and make all the duplication explicit (and double-check every field) so that we won't get bitten by something similar later.

ctm commented 9 months ago

Done. Deploying now (even though it won't change anything).