4 ms·
I really like this advice, but aren’t these two examples the same, but yet different advice? // Good? for walrus in walruses { walrus.frobnicate() } Is es
by bluejekyll 1y ago
I really like this advice, but aren’t these two examples the same, but yet different advice?
// Good?
for walrus in walruses {
walrus.frobnicate()
}
Is essentially equivalent to
// BAD
for walrus in walruses {
frobnicate(walrus)
}
And this is good,
// GOOD
frobnicate_batch(walruses)
So should the first one really be something more like
// impl FrobicateAll for &[Walrus]
walruses.frobicate_all()