Skip to content

Commit

Permalink
refactor: 🔨 Respect declaration ordering as the Rust style guide says
Browse files Browse the repository at this point in the history
  • Loading branch information
AntwortEinesLebens committed Jan 17, 2025
1 parent 203639e commit aba56cb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/commands/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ struct Metadata {
authors: Option<Vec<Author>>,
}

#[derive(Deserialize)]
struct Author {
name: String,
email: Option<String>,
}

#[derive(Parser)]
pub struct Generate {
#[clap(required = true, help = "Path to the generation file")]
path: PathBuf,
}

impl Display for Metadata {
fn fmt(&self, formatter: &mut Formatter) -> FormatResult {
let mut authors_lines: String = String::default();
Expand Down Expand Up @@ -61,12 +73,6 @@ impl Display for Metadata {
}
}

#[derive(Deserialize)]
struct Author {
name: String,
email: Option<String>,
}

impl Display for Author {
fn fmt(&self, formatter: &mut Formatter) -> FormatResult {
let mut email_line: String = String::default();
Expand All @@ -84,12 +90,6 @@ impl Display for Author {
}
}

#[derive(Parser)]
pub struct Generate {
#[clap(required = true, help = "Path to the generation file")]
path: PathBuf,
}

impl Runnable for Generate {
fn run(&self) -> ExitCode {
let Ok(path_exists) = self.path.try_exists() else {
Expand Down

0 comments on commit aba56cb

Please sign in to comment.