Unverified Commit e9b1f14c authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4329 from shuujii/use-FrozenError-instead-of-RuntimeError

Use `FrozenError` instead of `RuntimeError` in `String#rstrip!`
parents a1e12011 cd4daf78
...@@ -93,7 +93,7 @@ class String ...@@ -93,7 +93,7 @@ class String
# "hello".rstrip! #=> nil # "hello".rstrip! #=> nil
# #
def rstrip! 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.rstrip
(s == self) ? nil : self.replace(s) (s == self) ? nil : self.replace(s)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment