on master help sign in
Fix clippy warnings
commite27bdfc7d66f0b9a98ff0dc78113cccb96fefb19 authorsharkdp <davidpeter@web.de> dateThu 31 May 2018, 15:27 (8 years ago) parenta7f4f20
2 files changed+5−3
Cargo.lock+3−1 src/printer.rs+2−2
Cargo.lock+3−1
@@ -50,7 +50,7 @@ dependencies = [
5050 "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
5151 "git2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
5252 "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
53− "syntect 2.0.1",
53+ "syntect 2.0.1 (git+https://github.com/trishume/syntect?rev=c025dad49564e96322df4468fd268b65b91b2eae)",
5454]
5555
5656[[package]]
@@ -581,6 +581,7 @@ dependencies = [
581581[[package]]
582582name = "syntect"
583583version = "2.0.1"
584+source = "git+https://github.com/trishume/syntect?rev=c025dad49564e96322df4468fd268b65b91b2eae#c025dad49564e96322df4468fd268b65b91b2eae"
584585dependencies = [
585586 "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
586587 "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -840,6 +841,7 @@ dependencies = [
840841"checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b"
841842"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
842843"checksum syn 0.13.7 (registry+https://github.com/rust-lang/crates.io-index)" = "61b8f1b737f929c6516ba46a3133fd6d5215ad8a62f66760f851f7048aebedfb"
844+"checksum syntect 2.0.1 (git+https://github.com/trishume/syntect?rev=c025dad49564e96322df4468fd268b65b91b2eae)" = "<none>"
843845"checksum term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9e5b9a66db815dcfd2da92db471106457082577c3c278d4138ab3e3b4e189327"
844846"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
845847"checksum termios 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d9cf598a6d7ce700a4e6a9199da127e6819a61e64b68609683cc9a01b5683a"
src/printer.rs+2−2
@@ -47,7 +47,7 @@ impl<'a> Printer<'a> {
4747 // The grid border decoration isn't added until after the panel_width calculation, since the
4848 // print_horizontal_line, print_header, and print_footer functions all assume the panel
4949 // width is without the grid border.
50− if config.output_components.grid() && decorations.len() > 0 {
50+ if config.output_components.grid() && !decorations.is_empty() {
5151 decorations.push(Box::new(GridBorderDecoration::new(&colors)));
5252 }
5353
@@ -159,7 +159,7 @@ impl<'a> Printer<'a> {
159159 for &(style, region) in regions.iter() {
160160 let mut ansi_iterator = AnsiCodeIterator::new(region);
161161 let mut ansi_prefix = "";
162− while let Some(chunk) = ansi_iterator.next() {
162+ for chunk in ansi_iterator {
163163 match chunk {
164164 // ANSI escape passthrough.
165165 (text, true) => {