chroma
chroma copied to clipboard
Fix Ruby 3.4 frozen string warnings in normalize_input
Ruby 3.4 enables frozen string literals by default, which causes warnings when using destructive string methods (like strip! and downcase!) on frozen strings. This commit replaces the usage of input.clone.tap { |str| str.strip!; str.downcase! } with a non-mutating chain input.to_s.strip.downcase, which avoids mutating the original string and eliminates the warnings.
References:
- Ruby issue: https://bugs.ruby-lang.org/issues/20205
Any plans to review/merge this pull request?