mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-27 06:23:18 +00:00
cleanup: let newer Clippy fix a few things it found
This commit is contained in:
parent
94408f01e0
commit
8bbfe9731e
3 changed files with 7 additions and 10 deletions
|
@ -254,7 +254,7 @@ fn view_from_proto(proto: &crate::protos::op_store::View) -> View {
|
||||||
let local_target = branch_proto
|
let local_target = branch_proto
|
||||||
.local_target
|
.local_target
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|ref_target_proto| ref_target_from_proto(ref_target_proto));
|
.map(ref_target_from_proto);
|
||||||
|
|
||||||
let mut remote_targets = BTreeMap::new();
|
let mut remote_targets = BTreeMap::new();
|
||||||
for remote_branch in branch_proto.remote_branches.iter() {
|
for remote_branch in branch_proto.remote_branches.iter() {
|
||||||
|
|
|
@ -2242,9 +2242,7 @@ fn edit_description(repo: &ReadonlyRepo, description: &str) -> String {
|
||||||
.arg(&description_file_path)
|
.arg(&description_file_path)
|
||||||
.status()
|
.status()
|
||||||
.expect("failed to run editor");
|
.expect("failed to run editor");
|
||||||
if !exit_status.success() {
|
assert!(exit_status.success(), "failed to run editor");
|
||||||
panic!("failed to run editor");
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut description_file = OpenOptions::new()
|
let mut description_file = OpenOptions::new()
|
||||||
.read(true)
|
.read(true)
|
||||||
|
|
|
@ -412,12 +412,11 @@ pub fn parse_commit_template<'a>(
|
||||||
let first_pair = pairs.next().unwrap();
|
let first_pair = pairs.next().unwrap();
|
||||||
assert!(pairs.next().is_none());
|
assert!(pairs.next().is_none());
|
||||||
|
|
||||||
if first_pair.as_span().end() != template_text.len() {
|
assert!(
|
||||||
panic!(
|
!(first_pair.as_span().end() != template_text.len()),
|
||||||
"failed to parse template past position {}",
|
"failed to parse template past position {}",
|
||||||
first_pair.as_span().end()
|
first_pair.as_span().end()
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
parse_commit_template_rule(repo, first_pair)
|
parse_commit_template_rule(repo, first_pair)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue