Skip to content

Commit 2fca3df

Browse files
committedMar 16, 2024
test: fix tests not compiling
1 parent 81ab214 commit 2fca3df

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed
 

‎benches/show.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ fn show(c: &mut Criterion) {
1111
command: Some(Commands::Show {
1212
reference: "f4de01c0a12794d7b42a77b2138aa64119b90ea5".into(),
1313
}),
14-
log: false,
1514
print: true,
15+
..Default::default()
1616
},
1717
&mut terminal,
1818
)

‎src/cli.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
use clap::{Parser, Subcommand};
22

3-
#[derive(Debug, Parser)]
3+
#[derive(Default, Debug, Parser)]
44
#[command(name = crate::APP_NAME)]
55
#[command(flatten_help = true)]
66
pub struct Args {
77
#[command(subcommand)]
88
pub command: Option<Commands>,
99
/// Print one frame and exit. Useful for debugging.
10-
#[clap(long, action, default_value_t = false)]
10+
#[clap(long, action)]
1111
pub print: bool,
1212
/// Enable logging to 'gitu.log'
13-
#[clap(long, action, default_value_t = false)]
13+
#[clap(long, action)]
1414
pub log: bool,
1515

16-
#[clap(long, action, default_value_t = false)]
16+
#[clap(long, action)]
1717
/// Print version
1818
pub version: bool,
1919
}

‎tests/helpers.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ impl TestContext {
7575
let mut state = State::create(
7676
Repository::open(path).unwrap(),
7777
self.size,
78-
&Args {
79-
command: None,
80-
print: false,
81-
log: false,
82-
},
78+
&Args::default(),
8379
config::init_test_config().unwrap(),
8480
)
8581
.unwrap();

0 commit comments

Comments
 (0)
Please sign in to comment.