From 0003c36dfc0580ca46ad62045e7d694f2496f0c8 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sun, 3 Apr 2022 20:52:22 +0900 Subject: [PATCH] cli: rename DiffFormat struct to DiffFormatArgs This avoids future name conflicts. I want to extract the Format enum from show_diff(). --- src/commands.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index 3ab51890b..a64b42f47 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1014,7 +1014,7 @@ struct FilesArgs { #[derive(clap::Args, Clone, Debug)] #[clap(group(ArgGroup::new("format").args(&["summary", "git", "color-words"])))] -struct DiffFormat { +struct DiffFormatArgs { /// For each path, show only whether it was modified, added, or removed #[clap(long, short)] summary: bool, @@ -1051,7 +1051,7 @@ struct DiffArgs { /// Restrict the diff to these paths paths: Vec, #[clap(flatten)] - format: DiffFormat, + format: DiffFormatArgs, } /// Show commit description and changes in a revision @@ -1061,7 +1061,7 @@ struct ShowArgs { #[clap(default_value = "@")] revision: String, #[clap(flatten)] - format: DiffFormat, + format: DiffFormatArgs, } /// Show high-level repo status @@ -1093,7 +1093,7 @@ struct LogArgs { #[clap(long, short = 'p')] patch: bool, #[clap(flatten)] - format: DiffFormat, + format: DiffFormatArgs, } /// Show how a change has evolved @@ -2065,7 +2065,7 @@ fn show_diff( ui: &Ui, formatter: &mut dyn Formatter, workspace_command: &WorkspaceCommandHelper, - args: &DiffFormat, + args: &DiffFormatArgs, tree_diff: TreeDiffIterator, ) -> Result<(), CommandError> { enum Format { @@ -2775,7 +2775,7 @@ fn show_patch( formatter: &mut dyn Formatter, workspace_command: &WorkspaceCommandHelper, commit: &Commit, - args: &DiffFormat, + args: &DiffFormatArgs, ) -> Result<(), CommandError> { let parents = commit.parents(); let from_tree = merge_commit_trees(workspace_command.repo().as_repo_ref(), &parents);