-
Notifications
You must be signed in to change notification settings - Fork 3
docs: more documents and examples #13
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
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 adds comprehensive documentation and examples to the traversable crate, improving usability for new users through clear explanations and practical code examples.
- Adds module-level documentation with Quick Start guide and feature descriptions
- Enhances trait documentation with detailed examples for
Visitor,VisitorMut,Traversable, andTraversableMut - Adds examples to all helper functions in the
functionmodule - Updates README with Quick Start section
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| traversable/src/lib.rs | Adds comprehensive module-level documentation including Quick Start guide, examples for all traits, and feature descriptions |
| traversable/src/function.rs | Adds detailed documentation and examples for all visitor creation functions (make_visitor, make_visitor_enter, etc.) |
| traversable/src/combinator.rs | Updates import from std::ops::ControlFlow to core::ops::ControlFlow for consistency |
| README.md | Adds Quick Start section with complete example and attributes documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: tison <wander4096@gmail.com>
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
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
traversable/src/lib.rs
Outdated
| //! This crate provides [`Traversable`] and [`TraversableMut`] trait for types that can be | ||
| //! traversed, as well as [`Visitor`] and [`VisitorMut`] trait for types that perform the |
Copilot
AI
Dec 8, 2025
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.
Grammar issue: "trait" should be pluralized to "traits" since there are multiple traits being referenced (Traversable, TraversableMut, Visitor, and VisitorMut).
Suggested correction: "This crate provides [Traversable] and [TraversableMut] traits for types that can be traversed, as well as [Visitor] and [VisitorMut] traits for types that perform the traversal."
| //! This crate provides [`Traversable`] and [`TraversableMut`] trait for types that can be | |
| //! traversed, as well as [`Visitor`] and [`VisitorMut`] trait for types that perform the | |
| //! This crate provides [`Traversable`] and [`TraversableMut`] traits for types that can be | |
| //! traversed, as well as [`Visitor`] and [`VisitorMut`] traits for types that perform the |
README.md
Outdated
| impl Visitor for FileCounter { | ||
| type Break = (); | ||
|
|
||
| fn enter(&mut self, node: &dyn core::any::Any) -> ControlFlow<Self::Break> { |
Copilot
AI
Dec 8, 2025
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.
Inconsistency within the same code example: Line 35 uses std::ops::ControlFlow while line 62 uses core::any::Any. For consistency, either use std:: for both (since this example assumes the std feature is enabled) or use core:: for both. Recommend using std::any::Any to match the std::ops::ControlFlow on line 35.
| fn enter(&mut self, node: &dyn core::any::Any) -> ControlFlow<Self::Break> { | |
| fn enter(&mut self, node: &dyn std::any::Any) -> ControlFlow<Self::Break> { |
This closes #10