Skip to content

Commit 8048ea8

Browse files
committed
refactor: [#116] introduce ExitCode type alias
- Create ExitCode type alias for i32 exit codes - Update exec_with_exit_code() to return ExitCode type - Improves code readability and semantic clarity
1 parent 98b1b9c commit 8048ea8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/dependency-installer/tests/containers/running_binary_container.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ use testcontainers::{ContainerAsync, GenericImage};
88
use super::command_output::CommandOutput;
99
use super::container_id::ContainerId;
1010

11+
/// Exit code returned by a command execution
12+
pub type ExitCode = i32;
13+
1114
/// A running Ubuntu container with a binary installed and ready to execute
1215
///
1316
/// This struct provides methods for executing commands and managing a running
@@ -78,7 +81,7 @@ impl RunningBinaryContainer {
7881
///
7982
/// If the process was terminated by a signal (returns None from `code()`), we return 1
8083
/// to indicate failure rather than 0, which would incorrectly suggest success.
81-
pub fn exec_with_exit_code(&self, command: &[&str]) -> i32 {
84+
pub fn exec_with_exit_code(&self, command: &[&str]) -> ExitCode {
8285
let status = Command::new("docker")
8386
.arg("exec")
8487
.arg(&self.container_id)

0 commit comments

Comments
 (0)