Closed magicant closed 1 month ago
The recent changes streamline the system
module's API by simplifying method signatures and replacing TimeSpec
with the more idiomatic Duration
type for timeout handling. This enhances usability and clarity, allowing for easier integration of time-related functionality. Additionally, several public entities have been removed to refine the public interface, focusing on a more cohesive and user-friendly design.
Files | Change Summary |
---|---|
yash-env/src/system.rs |
Updated method signatures to replace TimeSpec with Duration in several functions, enhancing usability. |
yash-env/src/system/real.rs |
Removed TimeSpec imports, added to_timespec utility function for handling timeouts. |
yash-env/src/system/select.rs |
Simplified timeout handling logic, directly using Duration instead of TimeSpec . |
yash-env/src/system/shared.rs |
Modified select method signatures to utilize Duration , enhancing clarity and usability. |
yash-env/src/system/virtual.rs |
Changed select method to accept Duration , improving type safety and readability. |
sequenceDiagram
participant User
participant System
participant Library
User->>System: Call select(readers, writers, timeout, signal_mask)
System->>Library: Convert timeout to Duration
Library-->>System: Process with timeout
System-->>User: Return result
🐇 In the meadow where changes bloom,
A rabbit hops with joy and zoom!
With Durations now in hand so bright,
The code dances in pure delight!
Simplified paths, less fuss to see,
Hooray for change, oh happy me! 🌼✨
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 is part of #353.
Summary by CodeRabbit
New Features
Duration
type for better clarity and usability.Duration
to atimespec
structure.Bug Fixes
SelectSystem
andVirtualSystem
implementations, enhancing efficiency.Documentation
TimeSpec
to streamline the codebase.Refactor
Duration
across the system module.