-
Notifications
You must be signed in to change notification settings - Fork 6
refactor: add I/O utils & unit tests #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements the second stage of refactoring for the axio library, adding common I/O utilities including Chain, copy, Cursor, empty, repeat, sink, and Take. The changes enhance basic I/O traits and improve the project structure by organizing code into modules and upgrading to Rust 2024 edition.
Key Changes:
- Added comprehensive I/O utilities (
Chain,Copy,Cursor,Empty,Repeat,Sink,Take) - Implemented
BufWriterandLineWriterfor buffered writing - Enhanced
BufReaderwith improved buffer management usingBox<[MaybeUninit<u8>]>orheapless::Vec - Added extensive unit tests and benchmarks
- Upgraded to Rust 2024 edition and updated dependencies
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils.rs | Unit tests for Empty, Repeat, and Sink utilities |
| tests/io.rs | Comprehensive tests for core I/O operations including read/write/seek |
| tests/impls.rs | Benchmarks for slice and Vec read/write implementations |
| tests/cursor.rs | Tests for Cursor functionality with various backing types |
| tests/copy.rs | Tests for copy function and its specializations |
| tests/buffered.rs | Extensive tests for BufReader, BufWriter, and LineWriter |
| src/lib.rs | Refactored library entry point with modular organization |
| src/write/mod.rs | Write trait definition and default implementations |
| src/write/impls.rs | Write trait implementations for various types |
| src/read/mod.rs | Read and BufRead trait definitions with utilities |
| src/read/impls.rs | Read trait implementations for slices, VecDeque, etc. |
| src/seek/mod.rs | Seek trait definition |
| src/utils/*.rs | Utility types (Chain, Copy, Cursor, Empty, Repeat, Sink, Take) |
| src/buffered/*.rs | Buffered I/O implementations |
| Cargo.toml | Updated edition to 2024, dependencies to axerrno 0.2 |
| build.rs | Added maybe_uninit_slice feature detection |
| README.md | Enhanced documentation with features and limitations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
690beb2 to
20696c7
Compare
20696c7 to
71f1321
Compare
71f1321 to
48154a9
Compare
Depends: #8 #9
This is the third stage of refactoring, extracted from #4.
Changes
Chain/copy/Cursor/empty/repeat/sink/Take