-
Notifications
You must be signed in to change notification settings - Fork 0
CAT 020
unurgunite edited this page Jul 11, 2026
·
3 revisions
Severity:
warning• Confidence:high• Auto-fix: ✅
Tip
This rule supports auto-fix via --fix
IO::Memory for unread output — Creating an IO::Memory just to build a string that's immediately passed to a sink is wasteful. Use String.build instead.
io = IO::Memory.new
io << "hello"
io.to_sString.build { |io| io << "hello" }Tip
This rule can significantly improve performance in hot code paths.
Note
See bench results at bench/cat-020/