Skip to content

Commit 0116a65

Browse files
authored
style: format code to pass style check (#46)
* Reorder imports in api.rs and main.rs for consistency * Restructure match arms in config.rs to use blocks for better readability * Maintain consistent import ordering across files Signed-off-by: Qiming Chu <cchuqiming@gmail.com>
1 parent 2887121 commit 0116a65

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::config::Config;
22
use anyhow::{Context, Result};
33
use colored::Colorize;
44
use futures_util::StreamExt;
5-
use reqwest::{header, Response};
5+
use reqwest::{Response, header};
66
use serde::{Deserialize, Serialize};
77
use serde_json::Value;
88
use std::io::{self, Write};

src/config.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ pub struct Config {
2020
impl CommitFormat {
2121
pub fn get_prompt(&self) -> &'static str {
2222
match self {
23-
CommitFormat::Conventional =>
24-
"Please generate a concise and clear commit message using the common commit format (e.g. feat: add new feature).",
25-
CommitFormat::Bracketed =>
26-
"Please generate a concise and clear commit message using the bracketed format (e.g. [feat] add new feature).",
27-
CommitFormat::Plain =>
28-
"Please generate a concise and clear commit message using the plain format (e.g. add new feature).",
23+
CommitFormat::Conventional => {
24+
"Please generate a concise and clear commit message using the common commit format (e.g. feat: add new feature)."
25+
}
26+
CommitFormat::Bracketed => {
27+
"Please generate a concise and clear commit message using the bracketed format (e.g. [feat] add new feature)."
28+
}
29+
CommitFormat::Plain => {
30+
"Please generate a concise and clear commit message using the plain format (e.g. add new feature)."
31+
}
2932
}
3033
}
3134
}

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ mod api;
22
mod config;
33
mod git;
44

5-
use anyhow::{bail, Context, Result};
5+
use anyhow::{Context, Result, bail};
66
use clap::Parser;
77
use colored::Colorize;
88
use config::{CommitFormat, Config};

0 commit comments

Comments
 (0)