Skip to content

Commit

Permalink
Release 12.0.3
Browse files Browse the repository at this point in the history
[email protected]

Generated by cargo-workspaces
  • Loading branch information
XAMPPRocky committed Jun 22, 2020
1 parent 47c5ea6 commit 189fe14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = "MIT/Apache-2.0"
name = "tokei"
readme = "README.md"
repository = "https://github.com/XAMPPRocky/tokei.git"
version = "12.0.2"
version = "12.0.3"

[features]
all = ["cbor", "yaml"]
Expand Down
7 changes: 6 additions & 1 deletion src/language/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,13 @@ impl SyntaxCounter {
LanguageType::from_mime(&String::from_utf8_lossy(m.as_bytes().trim()))
})
.unwrap_or(LanguageType::JavaScript);
let script_contents = &lines[start_of_code..end_of_code];
if script_contents.trim().is_empty() {
return None
}

let stats = language.parse_from_slice(
&lines[start_of_code..end_of_code].trim_first_and_last_line_of_whitespace(),
script_contents.trim_first_and_last_line_of_whitespace(),
config,
);
Some(FileContext::new(
Expand Down

0 comments on commit 189fe14

Please sign in to comment.