Skip to content

Commit 1051bf6

Browse files
author
mendelsshop
committed
cargo formatted: uodated reame
1 parent 3b21684 commit 1051bf6

File tree

1 file changed

+9
-6
lines changed
  • git-function-history-lib/src/languages

1 file changed

+9
-6
lines changed

git-function-history-lib/src/languages/umpl.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ pub(crate) fn find_function_in_file(
6060
Err("no function found")?
6161
}
6262

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)> {
6468
let mut results = Vec::new();
6569
for node in ast {
6670
match node {
@@ -72,19 +76,19 @@ fn find_function_recurse(name: &str, ast: Vec<Thing>, current: &Vec<UMPLParentFu
7276
// TODO: get the function body
7377
body: String::new(),
7478
args_count: fns.num_arguments as usize,
75-
parents: current.clone()
79+
parents: current.clone(),
7680
};
7781
results.push(new_fn);
7882
} else {
7983
let mut new_current = current.clone();
8084
// turn into a parent function
81-
let pfn = UMPLParentFunction {
85+
let pfn = UMPLParentFunction {
8286
lines: (fns.line as usize, fns.end_line as usize),
8387
name: fns.name.to_string(),
8488
// TODO: get the top and bottom lines
8589
top: String::new(),
8690
bottom: String::new(),
87-
args_count: fns.num_arguments as usize
91+
args_count: fns.num_arguments as usize,
8892
};
8993
new_current.push(pfn);
9094
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
101105
}
102106
}
103107
results
104-
105108
}
106109

107110
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -111,4 +114,4 @@ impl UMPLFilter {
111114
pub fn matches(&self, function: &UMPLFunction) -> bool {
112115
false
113116
}
114-
}
117+
}

0 commit comments

Comments
 (0)