Skip to content

Commit

Permalink
refactor(cli): remove unnecessary mutable references to ui
Browse files Browse the repository at this point in the history
  • Loading branch information
aalhendi authored and marcoow committed Feb 5, 2025
1 parent 3df4ad5 commit 8ca13fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions blueprint/cli/src/bin/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ enum Commands {
}

#[allow(missing_docs)]
async fn cli(mut ui: &mut UI<'_>, cli: Cli) -> Result<(), anyhow::Error> {
async fn cli(ui: &mut UI<'_>, cli: Cli) -> Result<(), anyhow::Error> {
let config: Result<Config, anyhow::Error> = load_config(&cli.env);
match config {
Ok(config) => {
Expand All @@ -91,7 +91,7 @@ async fn cli(mut ui: &mut UI<'_>, cli: Cli) -> Result<(), anyhow::Error> {
Commands::Migrate => {
ui.info(&format!("Migrating {} database…", &cli.env));
ui.indent();
let migrations = migrate(&mut ui, &config.database)
let migrations = migrate(ui, &config.database)
.await
.context("Could not migrate database!");
ui.outdent();
Expand All @@ -110,7 +110,7 @@ async fn cli(mut ui: &mut UI<'_>, cli: Cli) -> Result<(), anyhow::Error> {
Commands::Reset => {
ui.info(&format!("Resetting {} database…", &cli.env));
ui.indent();
let result = reset(&mut ui, &config.database)
let result = reset(ui, &config.database)
.await
.context("Could not reset the database!");
ui.outdent();
Expand All @@ -119,7 +119,7 @@ async fn cli(mut ui: &mut UI<'_>, cli: Cli) -> Result<(), anyhow::Error> {
Ok(())
}
Commands::Prepare => {
if let Err(e) = ensure_sqlx_cli_installed(&mut ui).await {
if let Err(e) = ensure_sqlx_cli_installed(ui).await {
return Err(e.context("Error ensuring sqlx-cli is installed!"));
}

Expand Down

0 comments on commit 8ca13fe

Please sign in to comment.