mirror of
https://github.com/XAMPPRocky/tokei
synced 2024-10-05 23:39:28 +00:00
Only include children in total
This commit is contained in:
parent
55b98f3588
commit
34810da843
|
@ -89,6 +89,7 @@ macro_rules! supported_formats {
|
|||
for (language_type, language) in languages.into_iter() {
|
||||
map.insert(language_type.to_string(), json!(language));
|
||||
}
|
||||
|
||||
map.insert(String::from("Total"), json!(languages.total()));
|
||||
|
||||
match *self {
|
||||
|
|
|
@ -100,8 +100,12 @@ impl Languages {
|
|||
/// Summary of the Languages struct.
|
||||
pub fn total(self: &Languages) -> Language {
|
||||
let mut total = Language::new();
|
||||
for (_, language) in self {
|
||||
total += language.summarise();
|
||||
for (ty, language) in self {
|
||||
total.comments += language.comments;
|
||||
total.blanks += language.blanks;
|
||||
total.code += language.code;
|
||||
total.inaccurate |= language.inaccurate;
|
||||
total.children.insert(*ty, language.reports.clone());
|
||||
}
|
||||
total
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue