Closed magicant closed 1 month ago
The recent updates to the yash-env
system modules introduce significant changes to improve usability and clarity. Key modifications include replacing AtFlags
with a straightforward boolean parameter in the fstatat
method across various implementations, enhancing symbolic link handling. Other alterations simplify constants and streamline error handling. Overall, these changes aim to refine the API, making it more intuitive for developers while maintaining the core functionality.
Files | Change Summary |
---|---|
yash-env/.../system.rs , yash-env/.../real.rs , yash-env/.../shared.rs , yash-env/.../virtual.rs |
The fstatat method signature has been modified to use a follow_symlinks: bool parameter instead of flags: AtFlags , simplifying symbolic link handling. |
yash-env/src/pwd.rs |
The constant AT_FLAGS has been removed, with direct boolean values used in fstatat method calls, streamlining the code. |
yash-env/src/expansion/glob.rs |
The file_exists method now uses let ... else for error handling, enhancing readability, and replaces AtFlags::empty() with a boolean value in fstatat . |
sequenceDiagram
participant Developer
participant System
participant FileSystem
Developer->>System: Call fstatat(path, follow_symlinks)
System->>FileSystem: Check file status (follow_symlinks)
alt Follow symlink
FileSystem-->>System: Return file metadata
else Do not follow
FileSystem-->>System: Return symlink metadata
end
System-->>Developer: Return file status
π In fields of code, I leap and bound,
With changes bright, oh what joy I've found!
No flags to weigh me down, just clear intent,
In every method, my heartβs content.
So hereβs to updates, fresh and spry,
A hop, a skip, under the coding sky! π
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 pull request is part of #353 and removes the
AtFlags
type from theyash_env::system
module interface.Summary by CodeRabbit
New Features
Bug Fixes
file_exists
method, making it more concise and readable.Refactor
Tests