Remove repeated `contains` calls

This commit is contained in:
Lovecraftian Horror 2020-12-02 03:29:49 -05:00 committed by David Peter
parent ab4c120ea5
commit b349155f2f
2 changed files with 4 additions and 1 deletions

View File

@ -83,3 +83,4 @@ clap = { version = "2.33", optional = true }
[profile.release]
lto = true
codegen-units = 1
# debug = true

View File

@ -197,6 +197,8 @@ impl<'b> Controller<'b> {
let mut first_range: bool = true;
let mut mid_range: bool = false;
let style_snip = self.config.style_components.snip();
while reader.read_line(&mut line_buffer)? {
match line_ranges.check(line_number) {
RangeCheckResult::BeforeOrBetweenRanges => {
@ -207,7 +209,7 @@ impl<'b> Controller<'b> {
}
RangeCheckResult::InRange => {
if self.config.style_components.snip() {
if style_snip {
if first_range {
first_range = false;
mid_range = true;