Rubocop fix: Perfomance/UnfreezeString (#26217)

This commit is contained in:
Matt Jankowski
2023-07-28 17:11:05 -04:00
committed by GitHub
parent 4d1b67f664
commit 30f5ec7303
6 changed files with 33 additions and 18 deletions

View File

@ -2,6 +2,13 @@
doc = Ox::Document.new(version: '1.0')
ins = Ox::Instruct.new(:xml).tap do |instruct|
instruct[:version] = '1.0'
instruct[:encoding] = 'UTF-8'
end
doc << ins
doc << Ox::Element.new('XRD').tap do |xrd|
xrd['xmlns'] = 'http://docs.oasis-open.org/ns/xri/xrd-1.0'
@ -11,4 +18,4 @@ doc << Ox::Element.new('XRD').tap do |xrd|
end
end
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>#{Ox.dump(doc, effort: :tolerant)}".force_encoding('UTF-8')
Ox.dump(doc, effort: :tolerant).force_encoding('UTF-8')