This commit is contained in:
Aaronepower 2016-05-22 19:47:17 +01:00
parent 2b1bfa9f7d
commit f65a8c9825
3 changed files with 8 additions and 4 deletions

2
Cargo.lock generated
View File

@ -1,6 +1,6 @@
[root]
name = "tokei"
version = "2.0.0"
version = "2.1.1"
dependencies = [
"clap 2.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -14,8 +14,8 @@ build = "build.rs"
# For building serde in stable.
[build-dependencies]
serde_codegen = "0.10.0"
syntex = "0.7.5"
serde_codegen = "0.7.5"
syntex = "0.32.0"
# Dependencies, and why they are used.
# - Clap: For CLI argument parsing.

View File

@ -19,7 +19,11 @@ impl Stats {
impl fmt::Display for Stats {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let name = if self.name.len() > 24 {
let name_length = self.name.len();
let name = if name_length == 25 {
self.name.clone()
} else if self.name.len() > 24 {
let mut name = String::from("|");
name.push_str(&self.name[self.name.len() - 24..]);
name