Skip to content

Commit

Permalink
marks strings as mutable
Browse files Browse the repository at this point in the history
In preparation for all strings to be frozen as default, this gets test suite passing with RUBYOPT=--enable-frozen-string-literal
  • Loading branch information
radville committed Aug 28, 2024
1 parent e4f0e05 commit 66759e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/uuidtools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ def self.create_from_hash(hash_class, namespace, name)
##
# @api private
def self.convert_int_to_byte_string(integer, size)
byte_string = ""
byte_string = +""
if byte_string.respond_to?(:force_encoding)
byte_string.force_encoding(Encoding::ASCII_8BIT)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/uuidtools/uuid_parsing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@
it "should correctly parse raw bytes" do
# NOTE: Short Input
expect(UUIDTools::UUID.new(0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0])).to eql(
UUIDTools::UUID.parse_raw(""))
UUIDTools::UUID.parse_raw(+""))

# NOTE: Nil Input
expect(UUIDTools::UUID.parse_raw(
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
)).to be_nil_uuid

# NOTE: Realistic Input
Expand Down

0 comments on commit 66759e7

Please sign in to comment.