@@ -73,14 +73,7 @@ impl CppParser {
7373 ) ;
7474 }
7575 "namespace_definition" => {
76- self . extract_namespace (
77- child,
78- source,
79- file_path,
80- units,
81- next_id,
82- parent_qname,
83- ) ;
76+ self . extract_namespace ( child, source, file_path, units, next_id, parent_qname) ;
8477 }
8578 "enum_specifier" => {
8679 if let Some ( unit) =
@@ -91,14 +84,7 @@ impl CppParser {
9184 }
9285 "template_declaration" => {
9386 // Recurse into the template body to find the actual declaration
94- self . extract_from_node (
95- child,
96- source,
97- file_path,
98- units,
99- next_id,
100- parent_qname,
101- ) ;
87+ self . extract_from_node ( child, source, file_path, units, next_id, parent_qname) ;
10288 }
10389 "preproc_include" => {
10490 if let Some ( unit) =
@@ -109,14 +95,7 @@ impl CppParser {
10995 }
11096 // Top-level declarations wrapped in linkage_specification (extern "C" { ... })
11197 "linkage_specification" => {
112- self . extract_from_node (
113- child,
114- source,
115- file_path,
116- units,
117- next_id,
118- parent_qname,
119- ) ;
98+ self . extract_from_node ( child, source, file_path, units, next_id, parent_qname) ;
12099 }
121100 _ => { }
122101 }
@@ -145,8 +124,13 @@ impl CppParser {
145124 CodeUnitType :: Function
146125 } ;
147126
148- let mut unit =
149- RawCodeUnit :: new ( unit_type, Language :: Cpp , name, file_path. to_path_buf ( ) , span) ;
127+ let mut unit = RawCodeUnit :: new (
128+ unit_type,
129+ Language :: Cpp ,
130+ name,
131+ file_path. to_path_buf ( ) ,
132+ span,
133+ ) ;
150134 unit. temp_id = id;
151135 unit. qualified_name = qname;
152136 unit. visibility = Visibility :: Public ;
@@ -246,13 +230,9 @@ impl CppParser {
246230 }
247231 "declaration" | "field_declaration" => {
248232 // Check if it's a method declaration inside a class
249- if let Some ( unit) = self . extract_declaration (
250- child,
251- source,
252- file_path,
253- parent_qname,
254- next_id,
255- ) {
233+ if let Some ( unit) =
234+ self . extract_declaration ( child, source, file_path, parent_qname, next_id)
235+ {
256236 units. push ( unit) ;
257237 }
258238 }
@@ -345,8 +325,13 @@ impl CppParser {
345325 let id = * next_id;
346326 * next_id += 1 ;
347327
348- let mut unit =
349- RawCodeUnit :: new ( CodeUnitType :: Type , Language :: Cpp , name, file_path. to_path_buf ( ) , span) ;
328+ let mut unit = RawCodeUnit :: new (
329+ CodeUnitType :: Type ,
330+ Language :: Cpp ,
331+ name,
332+ file_path. to_path_buf ( ) ,
333+ span,
334+ ) ;
350335 unit. temp_id = id;
351336 unit. qualified_name = qname;
352337 unit. visibility = Visibility :: Public ;
@@ -437,10 +422,7 @@ impl LanguageParser for CppParser {
437422 }
438423
439424 fn is_test_file ( & self , path : & Path , _source : & str ) -> bool {
440- let name = path
441- . file_name ( )
442- . and_then ( |n| n. to_str ( ) )
443- . unwrap_or ( "" ) ;
425+ let name = path. file_name ( ) . and_then ( |n| n. to_str ( ) ) . unwrap_or ( "" ) ;
444426 name. ends_with ( "_test.cpp" )
445427 || name. ends_with ( "_test.cc" )
446428 || name. starts_with ( "test_" )
0 commit comments