Skip to content

Commit

Permalink
cli: remove unneeded Display for SparseInheritance
Browse files Browse the repository at this point in the history
Since it's a ValueEnum, clap knows how to stringify the default value.
  • Loading branch information
yuja committed Sep 7, 2024
1 parent b263882 commit 5bae3ea
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions cli/src/commands/workspace/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::fmt::Display;
use std::fs;

use itertools::Itertools;
Expand Down Expand Up @@ -43,16 +42,6 @@ enum SparseInheritance {
Empty,
}

impl Display for SparseInheritance {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
SparseInheritance::Copy => write!(f, "copy"),
SparseInheritance::Full => write!(f, "full"),
SparseInheritance::Empty => write!(f, "empty"),
}
}
}

/// Add a workspace
///
/// By default, the new workspace inherits the sparse patterns of the current
Expand Down Expand Up @@ -82,7 +71,7 @@ pub struct WorkspaceAddArgs {
#[arg(long, short)]
revision: Vec<RevisionArg>,
/// How to handle sparse patterns when creating a new workspace.
#[arg(long, default_value_t=SparseInheritance::Copy)]
#[arg(long, value_enum, default_value_t = SparseInheritance::Copy)]
sparse_patterns: SparseInheritance,
}

Expand Down

0 comments on commit 5bae3ea

Please sign in to comment.