Commit cd4daf78 authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

Use `FrozenError` instead of `RuntimeError` in `String#rstrip!`

parent 298807fa
...@@ -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