Project

General

Profile

Actions

Bug #17139

closed

[doc] StringScanner#matched_size seems to be byte-oriented but that is not documented

Added by akostadinov (Aleksandar Kostadinov) about 4 years ago. Updated about 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
[ruby-core:99820]

Description

StringScanner#matched_size seems to be byte oriented. But that is not documented. Better be documented to avoid confusion.

[1] pry(main)> ss = StringScanner.new([1024].pack("U*"))
[3] pry(main)> ss.skip_until(/./)
[4] pry(main)> ss.matched_size
=> 2
[5] pry(main)> ss.matched.size
=> 1

Actions #1

Updated by jeremyevans (Jeremy Evans) about 4 years ago

  • Status changed from Open to Closed

Applied in changeset git|d9b8411a7be4c9e300b75bc374f29e6965ab3040.


Document that StringScanner#matched_size returns size in bytes [ci skip]

Fixes [Bug #17139]

Actions

Also available in: Atom PDF

Like0
Like0