]> git.openstreetmap.org Git - rails.git/commitdiff
Fix rubocop warnings
authorTom Hughes <tom@compton.nu>
Tue, 18 Feb 2025 20:25:55 +0000 (20:25 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 18 Feb 2025 20:25:55 +0000 (20:25 +0000)
lib/rich_text.rb
lib/short_link.rb

index f38de7621c84d111ab5b6a952883d764dd965998..84e695c6e75a3be7639bc97dd68e898ffd6dc7b7 100644 (file)
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 module RichText
   SPAMMY_PHRASES = [
     "Business Description:", "Additional Keywords:"
@@ -144,7 +146,7 @@ module RichText
     end
 
     def truncated_text_content(element)
-      text = String.new
+      text = +""
 
       append_text = lambda do |child|
         if child.type == :text
index 2dfb0fb582baa1578b7710ced01b89b218fd17fd..eb73d60290701656749df8598a15cdbc8cbb1d00 100644 (file)
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 ##
 # Encodes and decodes locations from Morton-coded "quad tile" strings. Each
 # variable-length string encodes to a precision of one pixel per tile (roughly,
@@ -57,7 +59,7 @@ module ShortLink
     def encode(lon, lat, z)
       code = interleave_bits(((lon + 180.0) * (2**32) / 360.0).to_i,
                              ((lat + 90.0) * (2**32) / 180.0).to_i)
-      str = String.new
+      str = +""
       # add eight to the zoom level, which approximates an accuracy of
       # one pixel in a tile.
       ((z + 8) / 3.0).ceil.times do |i|