Fix for languages with no single line comments panicing

This commit is contained in:
Aaron Power 2016-11-27 18:13:30 +00:00
parent 02c8ebe122
commit bf304dd8eb
4 changed files with 4 additions and 4 deletions

2
Cargo.lock generated
View file

@ -1,6 +1,6 @@
[root] [root]
name = "tokei" name = "tokei"
version = "4.5.0" version = "4.5.2"
dependencies = [ dependencies = [
"clap 2.10.4 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -8,7 +8,7 @@ license = "MIT/Apache-2.0"
name = "tokei" name = "tokei"
readme = "README.md" readme = "README.md"
repository = "https://github.com/Aaronepower/tokei.git" repository = "https://github.com/Aaronepower/tokei.git"
version = "4.5.1" version = "4.5.2"
[build-dependencies] [build-dependencies]
serde = "~0.8.0" serde = "~0.8.0"
serde_json = "~0.8.0" serde_json = "~0.8.0"

View file

@ -5,7 +5,7 @@ about: Count Code, Quickly.
author: Aaron P. <theaaronepower@gmail.com> author: Aaron P. <theaaronepower@gmail.com>
bin_name: Tokei bin_name: Tokei
name: Tokei name: Tokei
version: 4.5.1 version: 4.5.2
args: args:
- exclude: - exclude:
help: Ignore all files & directories containing the word. help: Ignore all files & directories containing the word.

View file

@ -105,7 +105,7 @@ fn count_files(mut language_tuple: (&LanguageType, &mut Language)) {
&mut stack, &mut stack,
&mut quote &mut quote
); );
} else { } else if language.line_comment.len() != 0 {
let mut skip: u8 = 0; let mut skip: u8 = 0;
let window_size = language.line_comment.iter() let window_size = language.line_comment.iter()
.map(|a| a.len()) .map(|a| a.len())