forked from mirrors/jj
tree: drop Diff::as_options()
, use Diff::into_options()
instead
We don't have any current callers that only have a reference to a `Diff`, so we don't need `.as_options()`.
This commit is contained in:
parent
8af22eb83c
commit
b738f884c4
2 changed files with 3 additions and 11 deletions
|
@ -302,14 +302,6 @@ pub enum Diff<T> {
|
|||
}
|
||||
|
||||
impl<T> Diff<T> {
|
||||
pub fn as_options(&self) -> (Option<&T>, Option<&T>) {
|
||||
match self {
|
||||
Diff::Modified(left, right) => (Some(left), Some(right)),
|
||||
Diff::Added(right) => (None, Some(right)),
|
||||
Diff::Removed(left) => (Some(left), None),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn into_options(self) -> (Option<T>, Option<T>) {
|
||||
match self {
|
||||
Diff::Modified(left, right) => (Some(left), Some(right)),
|
||||
|
|
|
@ -713,12 +713,12 @@ pub fn show_types(
|
|||
) -> io::Result<()> {
|
||||
formatter.with_label("diff", |formatter| {
|
||||
for (repo_path, diff) in tree_diff {
|
||||
let (before, after) = diff.as_options();
|
||||
let (before, after) = diff.into_options();
|
||||
writeln!(
|
||||
formatter.labeled("modified"),
|
||||
"{}{} {}",
|
||||
diff_summary_char(before),
|
||||
diff_summary_char(after),
|
||||
diff_summary_char(before.as_ref()),
|
||||
diff_summary_char(after.as_ref()),
|
||||
workspace_command.format_file_path(&repo_path)
|
||||
)?;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue