mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #4329 from shuujii/use-FrozenError-instead-of-RuntimeError
Use `FrozenError` instead of `RuntimeError` in `String#rstrip!`
This commit is contained in:
@@ -93,7 +93,7 @@ class String
|
||||
# "hello".rstrip! #=> nil
|
||||
#
|
||||
def rstrip!
|
||||
raise RuntimeError, "can't modify frozen String" if frozen?
|
||||
raise FrozenError, "can't modify frozen String" if frozen?
|
||||
s = self.rstrip
|
||||
(s == self) ? nil : self.replace(s)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user