##// 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 447 let (narrow_matcher, narrow_warnings) = narrow::matcher(repo)?;
448 448
449 match revpair {
450 Some((rev1, rev2)) => {
451 let mut ds_status = DirstateStatus::default();
452 if list_copies {
453 return Err(CommandError::unsupported(
454 "status --rev --rev with copy information is not implemented yet",
455 ));
456 }
449 if let Some((rev1, rev2)) = revpair {
450 let mut ds_status = DirstateStatus::default();
451 if list_copies {
452 return Err(CommandError::unsupported(
453 "status --rev --rev with copy information is not implemented yet",
454 ));
455 }
457 456
458 let stat = hg::operations::status_rev_rev_no_copies(
459 repo,
460 rev1,
461 rev2,
462 narrow_matcher,
463 )?;
464 for entry in stat.iter() {
465 let (path, status) = entry?;
466 let path = StatusPath {
467 path: Cow::Borrowed(path),
468 copy_source: None,
469 };
470 match status {
471 hg::operations::DiffStatus::Removed => {
472 if display_states.removed {
473 ds_status.removed.push(path)
474 }
457 let stat = hg::operations::status_rev_rev_no_copies(
458 repo,
459 rev1,
460 rev2,
461 narrow_matcher,
462 )?;
463 for entry in stat.iter() {
464 let (path, status) = entry?;
465 let path = StatusPath {
466 path: Cow::Borrowed(path),
467 copy_source: None,
468 };
469 match status {
470 hg::operations::DiffStatus::Removed => {
471 if display_states.removed {
472 ds_status.removed.push(path)
475 473 }
476 hg::operations::DiffStatus::Added => {
477 if display_states.added {
478 ds_status.added.push(path)
479 }
474 }
475 hg::operations::DiffStatus::Added => {
476 if display_states.added {
477 ds_status.added.push(path)
480 478 }
481 hg::operations::DiffStatus::Modified => {
482 if display_states.modified {
483 ds_status.modified.push(path)
484 }
479 }
480 hg::operations::DiffStatus::Modified => {
481 if display_states.modified {
482 ds_status.modified.push(path)
485 483 }
486 hg::operations::DiffStatus::Matching => {
487 if display_states.clean {
488 ds_status.clean.push(path)
489 }
484 }
485 hg::operations::DiffStatus::Matching => {
486 if display_states.clean {
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 496 let (sparse_matcher, sparse_warnings) = sparse::matcher(repo)?;
General Comments 0
You need to be logged in to leave comments. Login now