cleanup: let newer Clippy fix a few things it found

This commit is contained in:
Martin von Zweigbergk 2021-10-11 12:52:57 -07:00
parent 94408f01e0
commit 8bbfe9731e
3 changed files with 7 additions and 10 deletions

View file

@ -254,7 +254,7 @@ fn view_from_proto(proto: &crate::protos::op_store::View) -> View {
let local_target = branch_proto
.local_target
.as_ref()
.map(|ref_target_proto| ref_target_from_proto(ref_target_proto));
.map(ref_target_from_proto);
let mut remote_targets = BTreeMap::new();
for remote_branch in branch_proto.remote_branches.iter() {

View file

@ -2242,9 +2242,7 @@ fn edit_description(repo: &ReadonlyRepo, description: &str) -> String {
.arg(&description_file_path)
.status()
.expect("failed to run editor");
if !exit_status.success() {
panic!("failed to run editor");
}
assert!(exit_status.success(), "failed to run editor");
let mut description_file = OpenOptions::new()
.read(true)

View file

@ -412,12 +412,11 @@ pub fn parse_commit_template<'a>(
let first_pair = pairs.next().unwrap();
assert!(pairs.next().is_none());
if first_pair.as_span().end() != template_text.len() {
panic!(
"failed to parse template past position {}",
first_pair.as_span().end()
);
}
assert!(
!(first_pair.as_span().end() != template_text.len()),
"failed to parse template past position {}",
first_pair.as_span().end()
);
parse_commit_template_rule(repo, first_pair)
}