Skip to content

Commit 8a258d9

Browse files
Copilotjosecelano
andcommitted
style: fix clippy warnings and format code
Co-authored-by: josecelano <[email protected]>
1 parent de6e811 commit 8a258d9

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/presentation/commands/context.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,7 @@ impl CommandContext {
152152
/// let ctx = CommandContext::new_with_factory(&factory, working_dir);
153153
/// ```
154154
#[must_use]
155-
pub fn new_with_factory(
156-
repository_factory: &RepositoryFactory,
157-
working_dir: PathBuf,
158-
) -> Self {
155+
pub fn new_with_factory(repository_factory: &RepositoryFactory, working_dir: PathBuf) -> Self {
159156
let repository = repository_factory.create(working_dir);
160157
let clock = Arc::new(SystemClock);
161158
let output = UserOutput::new(DEFAULT_VERBOSITY);

src/presentation/commands/create/subcommands/environment.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub fn handle_environment_creation(
5454

5555
// Step 2: Execute command (create handler before borrowing output)
5656
let command_handler = factory.create_create_handler(&ctx);
57-
let environment = execute_create_command(ctx.output(), command_handler, config)?;
57+
let environment = execute_create_command(ctx.output(), &command_handler, config)?;
5858

5959
// Step 3: Display results
6060
display_creation_results(ctx.output(), &environment);
@@ -120,7 +120,7 @@ fn load_configuration(
120120
/// Returns an error if command execution fails (e.g., environment already exists).
121121
fn execute_create_command(
122122
output: &mut UserOutput,
123-
command_handler: crate::application::command_handlers::CreateCommandHandler,
123+
command_handler: &crate::application::command_handlers::CreateCommandHandler,
124124
config: EnvironmentCreationConfig,
125125
) -> Result<Environment, CreateSubcommandError> {
126126
output.progress(&format!(
@@ -444,7 +444,7 @@ mod tests {
444444
let factory = CommandHandlerFactory::new();
445445
let ctx = factory.create_context(temp_dir.path().to_path_buf());
446446
let command_handler = factory.create_create_handler(&ctx);
447-
let result = execute_create_command(&mut output, command_handler, config);
447+
let result = execute_create_command(&mut output, &command_handler, config);
448448

449449
assert!(result.is_ok(), "Should execute command successfully");
450450
let environment = result.unwrap();
@@ -482,12 +482,12 @@ mod tests {
482482

483483
// Create environment first time
484484
let command_handler1 = factory.create_create_handler(&ctx);
485-
let result1 = execute_create_command(&mut output, command_handler1, config.clone());
485+
let result1 = execute_create_command(&mut output, &command_handler1, config.clone());
486486
assert!(result1.is_ok(), "First execution should succeed");
487487

488488
// Try to create same environment again
489489
let command_handler2 = factory.create_create_handler(&ctx);
490-
let result2 = execute_create_command(&mut output, command_handler2, config);
490+
let result2 = execute_create_command(&mut output, &command_handler2, config);
491491
assert!(result2.is_err(), "Second execution should fail");
492492

493493
match result2.unwrap_err() {
@@ -533,7 +533,8 @@ mod tests {
533533
let config = loader.load_from_file(&config_path).unwrap();
534534
let mut quiet_output = UserOutput::new(VerbosityLevel::Quiet);
535535
let command_handler = factory.create_create_handler(&ctx);
536-
let environment = execute_create_command(&mut quiet_output, command_handler, config).unwrap();
536+
let environment =
537+
execute_create_command(&mut quiet_output, &command_handler, config).unwrap();
537538

538539
// Test display function with custom output
539540
let stderr_buf = Vec::new();

0 commit comments

Comments
 (0)