summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2021-09-23 09:20:00 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2021-09-23 09:20:00 +0900
commite0c6e8c64ac3d7cf05a40acacb36dc60924af897 (patch)
treede33f785ff1bb34a9eec40ff17aeee4ad8789305 /string.c
parentfb976df81f99bb4505179ec02a74ece6cb6ffeee (diff)
[DOC] Use `unpack1` instead of `unpack(template)[0]` [ci skip]
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index 7f9559cb83..299d506004 100644
--- a/string.c
+++ b/string.c
@@ -10831,7 +10831,7 @@ enc_str_scrub(rb_encoding *enc, VALUE str, VALUE repl, int cr)
*
* "abc\u3042\x81".scrub #=> "abc\u3042\uFFFD"
* "abc\u3042\x81".scrub("*") #=> "abc\u3042*"
- * "abc\u3042\xE3\x80".scrub{|bytes| '<'+bytes.unpack('H*')[0]+'>' } #=> "abc\u3042<e380>"
+ * "abc\u3042\xE3\x80".scrub{|bytes| '<'+bytes.unpack1('H*')+'>' } #=> "abc\u3042<e380>"
*/
static VALUE
str_scrub(int argc, VALUE *argv, VALUE str)
@@ -10853,7 +10853,7 @@ str_scrub(int argc, VALUE *argv, VALUE str)
*
* "abc\u3042\x81".scrub! #=> "abc\u3042\uFFFD"
* "abc\u3042\x81".scrub!("*") #=> "abc\u3042*"
- * "abc\u3042\xE3\x80".scrub!{|bytes| '<'+bytes.unpack('H*')[0]+'>' } #=> "abc\u3042<e380>"
+ * "abc\u3042\xE3\x80".scrub!{|bytes| '<'+bytes.unpack1('H*')+'>' } #=> "abc\u3042<e380>"
*/
static VALUE
str_scrub_bang(int argc, VALUE *argv, VALUE str)