cleanup: remove unnecessary comments - #20
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes unnecessary comments from src/lib.rs to improve code readability and reduce clutter. The comments being removed are either overly explanatory for straightforward code or provide information that is already clear from the code itself.
Changes:
- Removed section separator comment for Error and Waker definitions
- Removed redundant documentation and inline comments from the
spawn_task!macro - Removed verbose explanatory comments from test helper functions and test setup
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -42,7 +41,6 @@ unsafe fn nop_clone(_data: *const ()) -> RawWaker { | |||
| } | |||
| static VTABLE: RawWakerVTable = RawWakerVTable::new(nop_clone, nop, nop, nop); | |||
|
|
|||
There was a problem hiding this comment.
The removal of documentation for the Task type alias leaves it without explanation. This type alias involves complex Rust concepts (Pin, trait objects, lifetime parameters) that would benefit from documentation explaining its purpose as a pinned future for the task queue.
Suggested change
| /// A pinned, dynamically-dispatched future representing a single task. | |
| /// | |
| /// This alias is the internal task type stored in the [`Spawner`]’s queue and | |
| /// wrapped by [`TaskHandle`]. It is a `Pin`ned mutable reference to a trait | |
| /// object implementing [`core::future::Future`] with `Output = ()`, and is | |
| /// required to be both `Send` and `Sync` so it can be safely scheduled. | |
| /// | |
| /// The lifetime parameter `'a` is the lifetime of the underlying borrowed | |
| /// future. Using `Pin` ensures that the future will not be moved in memory | |
| /// while it is being polled by the runtime. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.