summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-04-28 21:37:56 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-04-28 21:41:01 +0900
commite5e5acefaf922243aef707d8eff77f7e22db03fa (patch)
tree01d245f969c2e2169aeca49980f52c6a81c87150 /mrbgems
parent6666b4fa621a197bf15be11df0e1eb29b8588143 (diff)
downloadmruby-e5e5acefaf922243aef707d8eff77f7e22db03fa.tar.gz
mruby-e5e5acefaf922243aef707d8eff77f7e22db03fa.zip
string.{c,rb}: fix type of return values from some methods as Ruby3.0
When the receiver is the instance of subclass of `String`. - `String#each_char` - `String#each_line` - `String#partition`
Diffstat (limited to 'mrbgems')
-rw-r--r--mrbgems/mruby-string-ext/mrblib/string.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-string-ext/mrblib/string.rb b/mrbgems/mruby-string-ext/mrblib/string.rb
index 7544ac8f4..c61f427dc 100644
--- a/mrbgems/mruby-string-ext/mrblib/string.rb
+++ b/mrbgems/mruby-string-ext/mrblib/string.rb
@@ -148,7 +148,7 @@ class String
m = n + sep.size
[ slice(0, n), sep, slice(m, size - m) ]
else
- [ self, "", "" ]
+ [ self[0..-1], "", "" ]
end
end