Skip to content

Conversation

@AsakuraMizu
Copy link
Contributor

@AsakuraMizu AsakuraMizu commented Dec 24, 2025

Depends: #8 #9

This is the third stage of refactoring, extracted from #4.

Changes

  • Add common I/O utils, including Chain/copy/Cursor/empty/repeat/sink/Take
  • Add unit tests

@AsakuraMizu AsakuraMizu changed the title refactor: project structure, enhance basic traits refactor: add I/O utils & unit tests Dec 24, 2025
Copy link

Copilot AI left a 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 BufWriter and LineWriter for buffered writing
  • Enhanced BufReader with improved buffer management using Box<[MaybeUninit<u8>]> or heapless::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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants