Skip to content

Commit d2ef90c

Browse files
committed
chore: run cargo fmt on the code base
1 parent 8f52dcc commit d2ef90c

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

src/config.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,10 @@ pub fn get_current_project_name(config: &Config) -> Result<Option<String>, anyho
391391
let git_root = PathBuf::from(git::get_git_root(git::RunOpts::new(false, false))?);
392392

393393
if let Some(project_root) = find_project_root()? {
394-
if let Some(name) = project_root.file_name().map(|n| n.to_string_lossy().to_string()) {
394+
if let Some(name) = project_root
395+
.file_name()
396+
.map(|n| n.to_string_lossy().to_string())
397+
{
395398
return Ok(Some(name));
396399
}
397400
}
@@ -400,7 +403,10 @@ pub fn get_current_project_name(config: &Config) -> Result<Option<String>, anyho
400403
for project_dir in &config.monorepo.project_dirs {
401404
let project_path = git_root.join(project_dir);
402405
if current_dir.starts_with(&project_path) {
403-
if let Some(name) = project_path.file_name().map(|n| n.to_string_lossy().to_string()) {
406+
if let Some(name) = project_path
407+
.file_name()
408+
.map(|n| n.to_string_lossy().to_string())
409+
{
404410
println!("{}", name);
405411
return Ok(Some(name));
406412
}

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn main() -> anyhow::Result<()> {
9696
include_projects,
9797
} => {
9898
let inferred_scope = config::get_current_project_name(&config)?;
99-
99+
100100
// Resolve message from --message or --message-file
101101
let resolved_message = match (message, message_file) {
102102
(Some(m), _) => Some(m),

src/wizard.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ pub struct ChangeLogWizardResult {
3535
pub unreleased: bool,
3636
}
3737

38-
pub fn run_commit_wizard(config: &Config, default_scope: Option<String>) -> Result<CommitWizardResult> {
38+
pub fn run_commit_wizard(
39+
config: &Config,
40+
default_scope: Option<String>,
41+
) -> Result<CommitWizardResult> {
3942
let theme = ColorfulTheme::default();
4043

4144
// Load commit types from config or use defaults
@@ -75,7 +78,9 @@ pub fn run_commit_wizard(config: &Config, default_scope: Option<String>) -> Resu
7578
}
7679

7780
let mut scope_prompt = Input::<String>::with_theme(&theme);
78-
scope_prompt = scope_prompt.with_prompt("Enter the scope of this change (optional)").allow_empty(true);
81+
scope_prompt = scope_prompt
82+
.with_prompt("Enter the scope of this change (optional)")
83+
.allow_empty(true);
7984
if let Some(ds) = default_scope {
8085
scope_prompt = scope_prompt.with_initial_text(ds);
8186
}

0 commit comments

Comments
 (0)