4 ms·
I bet expect_empty could be defined roughly as: fn expect_empty(list) { drop_into(list, () => panic()); } (pardon my made up syntax) If you want to
by fallingsquirrel 2y ago
I bet expect_empty could be defined roughly as:
fn expect_empty(list) {
drop_into(list, () => panic());
}
(pardon my made up syntax)
If you want to discourage runtime checks, you could even make the programmer do the above themselves since it's a one-liner anyway.