Skip to content

Files

Latest commit

 

History

History
24 lines (15 loc) · 567 Bytes

Style-RedundantInterpolationUnfreeze.md

File metadata and controls

24 lines (15 loc) · 567 Bytes

Pattern: Redundant interpolation unfreeze

Issue: -

Description

Before Ruby 3.0, interpolated strings followed the frozen string literal magic comment which sometimes made it necessary to explicitly unfreeze them. Ruby 3.0 changed interpolated strings to always be unfrozen which makes unfreezing them redundant.

Examples

# bad
+"#{foo} bar"

# bad
"#{foo} bar".dup

# good
"#{foo} bar"

Further Reading