update: add CI, Example, Test and ReadmeTag#2
update: add CI, Example, Test and ReadmeTag#2Lfan-ke wants to merge 20 commits intoarceos-org:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces updated documentation, enhanced tests, CI configuration improvements, and modernizes various project files. Key updates include:
- Added detailed examples and extensive tests for I/O traits and buffered reading.
- Updated CI workflows and toolchain configuration for improved build/testing.
- Refined documentation and re-exports across modules, and updated Cargo.toml metadata.
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/prelude.rs | Added a doc comment for re-exported I/O traits. |
| src/lib.rs | Introduced new examples in docs and comprehensive tests. |
| src/impls.rs | Added documentation and tests for Read trait implementations. |
| src/error.rs | Documented re-export of error types. |
| src/buffered/mod.rs | Added module-level documentation. |
| src/buffered/bufreader.rs | Enhanced doc comments and added extensive tests for BufReader. |
| rust-toolchain | Updated toolchain configuration (nightly 2025-06-18). |
| README.md | Revamped layout with additional badges and examples. |
| Cargo.toml | Bumped version, updated edition, author list and dependency version. |
| .github/workflows/ci.yml | Improved CI configuration with updated actions and flags. |
Cargo.toml
Outdated
|
|
||
| [dependencies] | ||
| axerrno = "0.1" | ||
| axerrno = { version = "0.1.0" } |
Cargo.toml
Outdated
| edition = "2021" | ||
| authors = ["Yuekai Jia <equation618@gmail.com>"] | ||
| version = "0.1.2" | ||
| edition = "2024" |
There was a problem hiding this comment.
keep it as 2021 to make it compatible with more toolchain versions?
There was a problem hiding this comment.
the task of os camp is to make it run on the latest toolchain
There was a problem hiding this comment.
The bootcamp missions are not entirely correct. We prioritize the usability of the modules.
.github/workflows/ci.yml
Outdated
|
|
||
| on: [push, pull_request] | ||
| on: | ||
| push: |
There was a problem hiding this comment.
Why we don't trigger CI for other branch?
There was a problem hiding this comment.
gh-page? ci auto dispathch ci.
is updated now:
branches-ignore:
- 'gh-pages'
There was a problem hiding this comment.
i ignored if: ${{ github.ref == env.default-branch }} before commit and i have deleted on: push: now
.github/workflows/ci.yml
Outdated
| pull_request: | ||
| branches: [ main, master ] | ||
|
|
||
| workflow_dispatch: {} |
There was a problem hiding this comment.
Any need to add workflow_dispatch option?
There was a problem hiding this comment.
manually triggering online debugging is a very convenient feature
There was a problem hiding this comment.
Here is only for debug. But in the real condition maybe we doesn't need it?
src/buffered/mod.rs
Outdated
| //! | ||
| //! ``` | ||
| //! # #![allow(unused_imports)] | ||
| //! use std::io::BufReader; |
There was a problem hiding this comment.
Why here is std::io? And what does this comment mean?
src/impls.rs
Outdated
| let mut slice = &data[..]; | ||
| let mut buf = [0u8; 5]; | ||
|
|
||
| // 测试正常读取 |
.github/workflows/ci.yml
Outdated
| matrix: | ||
| rust-toolchain: [nightly] | ||
| targets: [x86_64-unknown-linux-gnu, x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat] | ||
| targets: [ x86_64-unknown-linux-gnu, x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none-softfloat ] |
| Ok(nread) | ||
| } | ||
|
|
||
| /// Reads exactly enough bytes to fill the buffer, using buffered data first |
There was a problem hiding this comment.
Maybe we should not mix the LINE_COMMENT and DOC_COMMENT?
src/buffered/bufreader.rs
Outdated
| } | ||
|
|
||
| #[test] | ||
| fn test_new() { |
There was a problem hiding this comment.
I think some test may be not necessary, like test_new?
No description provided.