Skip to content

Commit b53d58e

Browse files
committed
refactor: mark Args as non_exhaustive
1 parent cda3c50 commit b53d58e

File tree

7 files changed

+13
-0
lines changed

7 files changed

+13
-0
lines changed

src/args/cmd/fav.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser, Debug)]
4+
#[non_exhaustive]
45
pub struct Opt {
56
#[arg(verbatim_doc_comment)]
67
/// Show favorite list, order by time in DESC

src/args/cmd/ing.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use crate::api::ing::IngType;
22
use clap::{Parser, Subcommand};
33

44
#[derive(Parser, Debug)]
5+
#[non_exhaustive]
56
pub struct Opt {
67
#[command(subcommand)]
78
pub cmd: Option<Cmd>,
@@ -28,6 +29,7 @@ pub struct Opt {
2829
}
2930

3031
#[derive(Debug, Subcommand)]
32+
#[non_exhaustive]
3133
pub enum Cmd {
3234
#[clap(verbatim_doc_comment)]
3335
/// Show ing list, order by time in DESC

src/args/cmd/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub mod user;
77
use clap::Subcommand;
88

99
#[derive(Debug, Subcommand)]
10+
#[non_exhaustive]
1011
pub enum Cmd {
1112
/// User operations
1213
#[clap(visible_alias = "u")]

src/args/cmd/news.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser, Debug)]
4+
#[non_exhaustive]
45
pub struct Opt {
56
#[arg(verbatim_doc_comment)]
67
/// Show news list, order by time in DESC

src/args/cmd/post.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use clap::{Parser, Subcommand};
22

33
#[derive(Parser, Debug)]
4+
#[non_exhaustive]
45
pub struct Opt {
56
#[clap(verbatim_doc_comment)]
67
/// Show title and content of a specific post
@@ -51,6 +52,7 @@ pub struct Opt {
5152
}
5253

5354
#[derive(Parser, Debug)]
55+
#[non_exhaustive]
5456
pub struct CreateCmd {
5557
#[arg(verbatim_doc_comment)]
5658
/// Set post title
@@ -76,6 +78,7 @@ pub struct CreateCmd {
7678
}
7779

7880
#[derive(Parser, Debug)]
81+
#[non_exhaustive]
7982
pub struct UpdateCmd {
8083
#[arg(verbatim_doc_comment)]
8184
/// Set post title
@@ -102,6 +105,7 @@ pub struct UpdateCmd {
102105
}
103106

104107
#[derive(Parser, Debug)]
108+
#[non_exhaustive]
105109
pub struct SearchCmd {
106110
#[arg(verbatim_doc_comment)]
107111
/// Search self post
@@ -121,6 +125,7 @@ pub struct SearchCmd {
121125
}
122126

123127
#[derive(Debug, Subcommand)]
128+
#[non_exhaustive]
124129
pub enum Cmd {
125130
#[clap(verbatim_doc_comment)]
126131
/// Create post

src/args/cmd/user.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use clap::Parser;
22

33
#[derive(Parser, Debug)]
4+
#[non_exhaustive]
45
pub struct Opt {
56
#[arg(verbatim_doc_comment)]
67
/// Login with your personal access token (PAT)

src/args/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub enum TimeStyle {
1818
}
1919

2020
#[derive(Parser, Debug)]
21+
#[non_exhaustive]
2122
pub struct GlobalOpt {
2223
#[arg(verbatim_doc_comment)]
2324
/// Execute with specific PAT
@@ -82,6 +83,7 @@ pub struct GlobalOpt {
8283

8384
#[derive(Parser, Debug)]
8485
#[command(author, about, long_about = None, version)]
86+
#[non_exhaustive]
8587
pub struct Args {
8688
#[command(subcommand)]
8789
pub cmd: Option<Cmd>,

0 commit comments

Comments
 (0)