@@ -60,7 +60,11 @@ pub(crate) fn find_function_in_file(
60
60
Err ( "no function found" ) ?
61
61
}
62
62
63
- fn find_function_recurse ( name : & str , ast : Vec < Thing > , current : & Vec < UMPLParentFunction > ) -> Vec < ( UMPLFunction ) > {
63
+ fn find_function_recurse (
64
+ name : & str ,
65
+ ast : Vec < Thing > ,
66
+ current : & Vec < UMPLParentFunction > ,
67
+ ) -> Vec < ( UMPLFunction ) > {
64
68
let mut results = Vec :: new ( ) ;
65
69
for node in ast {
66
70
match node {
@@ -72,19 +76,19 @@ fn find_function_recurse(name: &str, ast: Vec<Thing>, current: &Vec<UMPLParentFu
72
76
// TODO: get the function body
73
77
body : String :: new ( ) ,
74
78
args_count : fns. num_arguments as usize ,
75
- parents : current. clone ( )
79
+ parents : current. clone ( ) ,
76
80
} ;
77
81
results. push ( new_fn) ;
78
82
} else {
79
83
let mut new_current = current. clone ( ) ;
80
84
// turn into a parent function
81
- let pfn = UMPLParentFunction {
85
+ let pfn = UMPLParentFunction {
82
86
lines : ( fns. line as usize , fns. end_line as usize ) ,
83
87
name : fns. name . to_string ( ) ,
84
88
// TODO: get the top and bottom lines
85
89
top : String :: new ( ) ,
86
90
bottom : String :: new ( ) ,
87
- args_count : fns. num_arguments as usize
91
+ args_count : fns. num_arguments as usize ,
88
92
} ;
89
93
new_current. push ( pfn) ;
90
94
results. append ( & mut find_function_recurse ( name, fns. body , & new_current) ) ;
@@ -101,7 +105,6 @@ fn find_function_recurse(name: &str, ast: Vec<Thing>, current: &Vec<UMPLParentFu
101
105
}
102
106
}
103
107
results
104
-
105
108
}
106
109
107
110
#[ derive( Debug , Clone , PartialEq , Eq ) ]
@@ -111,4 +114,4 @@ impl UMPLFilter {
111
114
pub fn matches ( & self , function : & UMPLFunction ) -> bool {
112
115
false
113
116
}
114
- }
117
+ }
0 commit comments