From 552a5a993c5af520926d1b1689d59c70bd1298af Mon Sep 17 00:00:00 2001 From: mame Date: Mon, 29 Jan 2018 08:40:22 +0000 Subject: [PATCH] string.c (rb_str_format_m): Fix the example code of the doc Change `%08x` to `%016x` because of two reasons: * `%016x` demonstrates that we can use two or more digits here. * Currently, many people uses 64-bit environment. (I'm unsure if object_id is a good example here, though...) I'm unsure if git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/string.c b/string.c index 9079387fac..90347246f9 100644 --- a/string.c +++ b/string.c @@ -1988,7 +1988,7 @@ rb_str_times(VALUE str, VALUE times) * details of the format string. * * "%05d" % 123 #=> "00123" - * "%-5s: %08x" % [ "ID", self.object_id ] #=> "ID : 200e14d6" + * "%-5s: %016x" % [ "ID", self.object_id ] #=> "ID : 00002b054ec93168" * "foo = %{foo}" % { :foo => 'bar' } #=> "foo = bar" */