diff options
author | Marc-Andre Lafortune <github@marc-andre.ca> | 2020-12-20 21:39:56 -0500 |
---|---|---|
committer | Marc-André Lafortune <github@marc-andre.ca> | 2020-12-23 01:08:38 -0500 |
commit | 0eb94dae4aec58de06051cf89d555994838452f2 (patch) | |
tree | 4adef62f3c41c5a574ac02d43fae0e129782aa0c /ext/psych | |
parent | 0dd4896175f95c4c2a26d91a97b9fcb9a74cc0c6 (diff) |
[ruby/psych] Freeze constants.
Improves Ractor-readiness.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3953
Diffstat (limited to 'ext/psych')
-rw-r--r-- | ext/psych/lib/psych.rb | 4 | ||||
-rw-r--r-- | ext/psych/lib/psych/class_loader.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb index c3292d9172..347160e82f 100644 --- a/ext/psych/lib/psych.rb +++ b/ext/psych/lib/psych.rb @@ -233,9 +233,9 @@ require 'psych/class_loader' module Psych # The version of libyaml Psych is using - LIBYAML_VERSION = Psych.libyaml_version.join '.' + LIBYAML_VERSION = Psych.libyaml_version.join('.').freeze # Deprecation guard - NOT_GIVEN = Object.new + NOT_GIVEN = Object.new.freeze private_constant :NOT_GIVEN ### diff --git a/ext/psych/lib/psych/class_loader.rb b/ext/psych/lib/psych/class_loader.rb index cfca86845a..f62798c36d 100644 --- a/ext/psych/lib/psych/class_loader.rb +++ b/ext/psych/lib/psych/class_loader.rb @@ -69,7 +69,7 @@ module Psych rescue nil end - }.compact] + }.compact].freeze class Restricted < ClassLoader def initialize classes, symbols |