There are two ways of enabling all strings in a file to be implicitly frozen1.
# frozen-string-literal: true
# frozen_string_literal: true
Is there a difference between these two syntaxes?
Thanks!
There are two ways of enabling all strings in a file to be implicitly frozen1.
# frozen-string-literal: true
# frozen_string_literal: true
Is there a difference between these two syntaxes?
Thanks!
The answer you link to never uses the magic comment # frozen-string-literal: true
only # frozen_string_literal: true
. The difference is that only the latter will work.
The other way to enable frozen string literals is to run the application with the --enable=frozen-string-literal
flag.