Skip to content

Commit 3b537de

Browse files
committed
Migrate to Data#should_generate_struct?
1 parent 4e8c140 commit 3b537de

File tree

1 file changed

+1
-10
lines changed
  • _tools/ruby_h_to_go/lib/ruby_header_parser

1 file changed

+1
-10
lines changed

_tools/ruby_h_to_go/lib/ruby_header_parser/parser.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def extract_struct_definitions
6262

6363
struct_name = parts[0]
6464

65-
next unless should_generate_struct?(struct_name)
65+
next unless data.should_generate_struct?(struct_name)
6666

6767
definitions << StructDefinition.new(
6868
name: struct_name,
@@ -107,15 +107,6 @@ def read_definition_from_header_file(file, line_num)
107107
""
108108
end
109109

110-
# Whether generate C struct to go
111-
# @param struct_name [String]
112-
# @return [Boolean]
113-
def should_generate_struct?(struct_name)
114-
struct_name = struct_name.downcase
115-
116-
struct_name.start_with?("rb_")
117-
end
118-
119110
ALLOW_TYPE_NAME_PREFIXES = %w[rb_ st_].freeze
120111
ALLOW_TYPE_NAMES = %w[id value].freeze
121112

0 commit comments

Comments
 (0)