Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove repeated contains calls #1421

Merged
merged 2 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,4 @@ clap = { version = "2.33", optional = true }
[profile.release]
lto = true
codegen-units = 1
# debug = true
4 changes: 3 additions & 1 deletion src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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;
Expand Down