[ruby/tmpdir] Make Dir.tmpdir more idiomatic and functional
Use Enumerable#find to iterate over the candidates, not Enumerable.each.
(this makes the code more functional, and - IMO - slightly more idiomatic,
as it avoids setting the "global" (by which I mean: non-local) tmp
variable from inside the block)
[ruby/tmpdir] Make
Dir.tmpdir
more idiomatic and functionalUse
Enumerable#find
to iterate over the candidates, notEnumerable.each
.(this makes the code more functional, and - IMO - slightly more idiomatic,
as it avoids setting the "global" (by which I mean: non-local)
tmp
variable from inside the block)
https://github.com/ruby/tmpdir/commit/d1f20ad694