Closed magicant closed 3 weeks ago
The changes across various files primarily enhance the control flow and error handling of input/output operations related to terminal interactions. Key modifications include transitioning function return types from Result<bool>
to simpler bool
, streamlining logic, and updating dependencies to newer versions for potential improvements. These updates ensure that the codebase remains efficient and maintainable.
File | Change Summary |
---|---|
yash-builtin/src/read/input.rs |
Consolidated early exit conditions in print_prompt for streamlined control flow. |
yash-cli/Cargo.toml |
Updated nix dependency from 0.27.0 to 0.29.0 . |
yash-cli/src/startup.rs |
Removed error handling from auto_interactive function’s isatty calls, altering behavior. |
yash-cli/src/startup/input.rs |
Eliminated unwrap_or(false) from prepare_input , impacting error handling behavior. |
yash-cli/tests/pty/mod.rs |
Replaced raw file descriptor usage with BorrowedFd for improved safety. |
yash-env/CHANGELOG.md |
Simplified return types in system::System methods; updated open and umask method signatures. |
yash-env/Cargo.toml |
Updated nix dependency from 0.27.0 to 0.29.0 . |
yash-env/src/lib.rs |
Simplified should_print_error_in_color to directly return result of isatty(Fd::STDERR) . |
yash-env/src/system.rs |
Changed isatty method signature from Result<bool> to bool , altering error handling. |
yash-env/src/system/errno.rs |
Modified error conversion implementation from from_i32 to from_raw for nix::Error . |
yash-env/src/system/real.rs |
Transitioned to direct libc calls for lower-level system function implementations. |
yash-env/src/system/shared.rs |
Updated isatty method signature to return bool instead of Result<bool> , simplifying usage. |
yash-env/src/system/virtual.rs |
Simplified isatty function to return bool , eliminating error handling. |
sequenceDiagram
participant User
participant Terminal
participant System
User->>Terminal: Input command
Terminal->>System: Check if input is from terminal (isatty)
alt isatty returns true
System->>Terminal: Ready for input
else isatty returns false
System->>User: Invalid input source
end
🐰 In fields of green, I hop with glee,
Changes abound, oh joy for me!
With code so neat and errors few,
A simpler path for all to pursue!
Hooray forisatty
, now it’s bright,
Let’s code away, from morn till night! 🌼
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?
Summary by CodeRabbit
New Features
nix
crate to the latest version, potentially introducing new features and bug fixes.Bug Fixes
Refactor
Documentation