on master help sign in
Remove repeated `contains` calls
commitb349155f2f959eeeb339824830ec205ff8642295 authorLovecraftian Horror <LovecraftianHorror@pm.me> dateWed 2 Dec 2020, 03:29 (6 years ago) parentab4c120
2 files changed+4−1
Cargo.toml+1 src/controller.rs+3−1
Cargo.toml+1
@@ -83,3 +83,4 @@ clap = { version = "2.33", optional = true }
8383[profile.release]
8484lto = true
8585codegen-units = 1
86+# debug = true
src/controller.rs+3−1
@@ -197,6 +197,8 @@ impl<'b> Controller<'b> {
197197 let mut first_range: bool = true;
198198 let mut mid_range: bool = false;
199199
200+ let style_snip = self.config.style_components.snip();
201+
200202 while reader.read_line(&mut line_buffer)? {
201203 match line_ranges.check(line_number) {
202204 RangeCheckResult::BeforeOrBetweenRanges => {
@@ -207,7 +209,7 @@ impl<'b> Controller<'b> {
207209 }
208210
209211 RangeCheckResult::InRange => {
210− if self.config.style_components.snip() {
212+ if style_snip {
211213 if first_range {
212214 first_range = false;
213215 mid_range = true;