Closed magicant closed 3 months ago
The recent updates across multiple files in the yash
project involve a significant refactoring of process state management. The changes primarily focus on renaming and restructuring ProcessState
variants to use lowercase methods such as stopped
and exited
. Additionally, the introduction of ProcessResult
improves handling of process states and exit statuses. These modifications ensure a more consistent and clear representation of process states within the codebase.
Files/Paths | Change Summary |
---|---|
yash-builtin/src/bg.rs |
Updated ProcessState enum values from uppercase to lowercase. |
yash-builtin/src/fg.rs |
Renamed wait_while_running to wait_until_halt , updated process state handling, and adjusted test assertions. |
yash-builtin/src/jobs.rs |
Added ProcessResult import, changed ProcessState variants to lowercase. |
yash-builtin/src/kill/send.rs |
Updated ProcessState::Exited to ProcessState::exited and removed ExitStatus import. |
yash-builtin/src/wait/core.rs |
Changed ProcessState calls from uppercase to lowercase in tests. |
yash-builtin/src/wait/status.rs |
Refactored job_status function to handle ProcessState::Halted(result) and updated state assignments. |
yash-env/CHANGELOG.md |
Documented changes to ProcessResult and ProcessState including new methods and restructuring. |
yash-env/src/job.rs |
Redefined ProcessResult , introduced new ProcessState enum, and updated methods for process state handling. |
yash-env/src/job/fmt.rs |
Renamed ProcessState to ProcessResult and adjusted formatting logic. |
yash-env/src/lib.rs |
Refactored wait_for_subshell and updated test assertions to use new process state methods. |
yash-env/src/subshell.rs |
Changed return type of start_and_wait to use ProcessResult instead of ProcessState . |
yash-env/src/system/virtual.rs |
Added handling for ProcessState::Halted(result) and updated process state logic accordingly. |
yash-env/src/system/virtual/process.rs |
Refactored logic in Process struct to use ProcessState::Halted and updated tests. |
yash-semantics/src/command/compound_command/... | Removed ProcessStateimport, adjusted logic to use ProcessResult`, and updated test cases. |
|
yash-semantics/src/command/pipeline.rs |
Refactored job control pipelines to use ProcessResult instead of ProcessState . |
🐇 In code's deep warren, changes sprout, Process states, now lowercase, no doubt.
Stopped
andExited
take new form,ProcessResult
keeps them warm. Refactor done, the code refined, A rabbit's joy, in lines aligned. 🥕
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This refactoring project introduces the
ProcessResult
enum, which is represents the state of a process but theRunning
state. TheProcessState
enum is redefined in terms ofProcessResult
. This allows more fine-grained type checking on conversion from those enum toExitStatus
.ProcessResult
ProcessState
in terms ofProcessResult
ProcessResult
fromSubshell::start_and_wait