-
Notifications
You must be signed in to change notification settings - Fork 859
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] Use a
for
loop in LifetimeTracker
triage code.
A `for` loop is less noisy than a `drain`, which requires: - a `mut` qualifier for a variable whose modified value we never consult - a method name appearing mid-line instead of a control structure name at the front of the line - a range which is always `..`, establishing no restriction at all - a closure instead of a block Structured control flow syntax has a fine pedigree, originating in, among other places, Dijkstrsa's efforts at designing languages in a way that made it easier to formally verify programs written in them (see "A Discipline Of Programming"). There is nothing "more mathematical" about a method call that takes a closure than a `for` loop. Since `for_each` is useless unless the closure has side effects, there's nothing "more functional" about `for_each` here, either. Obsessive use of `for_each` suggests that the author loves Haskell without understanding it.
- Loading branch information
Showing
1 changed file
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters