mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/scanf.rb (Scanf::FormatSpecifier#letter, #width): use matched
substring directly. * ext/nkf/lib/kconv.rb (Kconv.conv): get rid of nil.to_a. * test/ruby/test_assignment.rb, test/ruby/test_iterator.rb: followed change of sample/test.rb. * test/net/http/test_http.rb: removed superfluous splatting stars. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8fb6f790fe
commit
ec12edb11c
6 changed files with 18 additions and 69 deletions
|
@ -467,11 +467,11 @@ module Scanf
|
|||
end
|
||||
|
||||
def letter
|
||||
/%\*?\d*([a-z\[])/.match(@spec_string).to_a[1]
|
||||
@spec_string[/%\*?\d*([a-z\[])/, 1]
|
||||
end
|
||||
|
||||
def width
|
||||
w = /%\*?(\d+)/.match(@spec_string).to_a[1]
|
||||
w = @spec_string[/%\*?(\d+)/, 1]
|
||||
w && w.to_i
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue