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

Cleanups #265

Merged
merged 2 commits into from
Sep 28, 2024
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
Prev Previous commit
Fix clippy::manual_unwrap_or
  • Loading branch information
fox0 authored and jgarzik committed Sep 28, 2024
commit 110e0a3571776a9f269fa68fd68dc9a28d99f332
11 changes: 2 additions & 9 deletions misc/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,9 @@ fn parse_binary_op(s: &str) -> Option<BinOp> {
}
}

fn parse_int(s: &str) -> i64 {
match s.parse::<i64>() {
Ok(i) => i,
Err(_) => 0,
}
}

fn eval_binary_int(op: &BinOp, s1: &str, s2: &str) -> bool {
let i1 = parse_int(s1);
let i2 = parse_int(s2);
let i1: i64 = s1.parse().unwrap_or(0);
let i2: i64 = s2.parse().unwrap_or(0);

match op {
BinOp::IntEq => i1 == i2,
Expand Down
12 changes: 4 additions & 8 deletions text/pr_util/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,10 @@ impl Parameters {

let (first_page, last_page) = args.pages.unwrap_or((1, None));

let num_columns = {
if args.merge {
args.file.len()
} else if let Some(n) = args.columns {
n
} else {
1
}
let num_columns = if args.merge {
args.file.len()
} else {
args.columns.unwrap_or(1)
};

let form_feed = args.form_feed || args.form_feed_with_pause;
Expand Down