##// END OF EJS Templates
rust-clippy: simplify `match` to `if let`...
Raphaël Gomès -
r52164:eab5b061 default
parent child Browse files
Show More
@@ -446,54 +446,51 b' pub fn run(invocation: &crate::CliInvoca'
446 };
446 };
447 let (narrow_matcher, narrow_warnings) = narrow::matcher(repo)?;
447 let (narrow_matcher, narrow_warnings) = narrow::matcher(repo)?;
448
448
449 match revpair {
449 if let Some((rev1, rev2)) = revpair {
450 Some((rev1, rev2)) => {
450 let mut ds_status = DirstateStatus::default();
451 let mut ds_status = DirstateStatus::default();
451 if list_copies {
452 if list_copies {
452 return Err(CommandError::unsupported(
453 return Err(CommandError::unsupported(
453 "status --rev --rev with copy information is not implemented yet",
454 "status --rev --rev with copy information is not implemented yet",
454 ));
455 ));
455 }
456 }
457
456
458 let stat = hg::operations::status_rev_rev_no_copies(
457 let stat = hg::operations::status_rev_rev_no_copies(
459 repo,
458 repo,
460 rev1,
459 rev1,
461 rev2,
460 rev2,
462 narrow_matcher,
461 narrow_matcher,
463 )?;
462 )?;
464 for entry in stat.iter() {
463 for entry in stat.iter() {
465 let (path, status) = entry?;
464 let (path, status) = entry?;
466 let path = StatusPath {
465 let path = StatusPath {
467 path: Cow::Borrowed(path),
466 path: Cow::Borrowed(path),
468 copy_source: None,
467 copy_source: None,
469 };
468 };
470 match status {
469 match status {
471 hg::operations::DiffStatus::Removed => {
470 hg::operations::DiffStatus::Removed => {
472 if display_states.removed {
471 if display_states.removed {
473 ds_status.removed.push(path)
472 ds_status.removed.push(path)
474 }
475 }
473 }
476 hg::operations::DiffStatus::Added => {
474 }
477 if display_states.added {
475 hg::operations::DiffStatus::Added => {
478 ds_status.added.push(path)
476 if display_states.added {
479 }
477 ds_status.added.push(path)
480 }
478 }
481 hg::operations::DiffStatus::Modified => {
479 }
482 if display_states.modified {
480 hg::operations::DiffStatus::Modified => {
483 ds_status.modified.push(path)
481 if display_states.modified {
484 }
482 ds_status.modified.push(path)
485 }
483 }
486 hg::operations::DiffStatus::Matching => {
484 }
487 if display_states.clean {
485 hg::operations::DiffStatus::Matching => {
488 ds_status.clean.push(path)
486 if display_states.clean {
489 }
487 ds_status.clean.push(path)
490 }
488 }
491 }
489 }
492 }
490 }
493 output.output(display_states, ds_status)?;
494 return Ok(());
495 }
491 }
496 None => (),
492 output.output(display_states, ds_status)?;
493 return Ok(());
497 }
494 }
498
495
499 let (sparse_matcher, sparse_warnings) = sparse::matcher(repo)?;
496 let (sparse_matcher, sparse_warnings) = sparse::matcher(repo)?;
General Comments 0
You need to be logged in to leave comments. Login now