Skip to content

Commit

Permalink
Fix clippy::empty_line_after_doc_comments warning
Browse files Browse the repository at this point in the history
```
error: empty line after doc comment
   --> src/runnable.rs:831:5
    |
831 | /     /// use async_task::{Runnable, spawn};
832 | |
    | |_^
...
845 |       pub fn into_raw(self) -> NonNull<()> {
    |       ------------------------------------ the comment documents this method
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
    = note: `-D clippy::empty-line-after-doc-comments` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::empty_line_after_doc_comments)]`
    = help: if the empty line is unintentional remove it
help: if the documentation should include the empty line include it in the comment
    |
832 |     ///
    |

error: empty lines after doc comment
   --> src/runnable.rs:868:5
    |
868 | /     /// use async_task::{Runnable, spawn};
869 | |
870 | |     /// let (runnable, task) = spawn(async {}, |_| {});
871 | |     /// let runnable_pointer = runnable.into_raw();
...   |
882 | |     /// ```
883 | |
    | |_^
884 |       /// [into_raw]: #method.into_raw
885 |       pub unsafe fn from_raw(ptr: NonNull<()>) -> Self {
    |       ------------------------------------------------ the comment documents this associated function
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
    = help: if the empty lines are unintentional remove them
help: if the documentation should include the empty lines include them in the comment
    |
869 +     ///
870 |     /// let (runnable, task) = spawn(async {}, |_| {});
...
882 |     /// ```
883 +     ///
    |
```
  • Loading branch information
taiki-e committed Jan 23, 2025
1 parent 9266e14 commit 419aa39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runnable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ impl<M> Runnable<M> {
///
/// ```rust
/// use async_task::{Runnable, spawn};
///
/// let (runnable, task) = spawn(async {}, |_| {});
/// let runnable_pointer = runnable.into_raw();
///
Expand Down Expand Up @@ -866,7 +866,7 @@ impl<M> Runnable<M> {
///
/// ```rust
/// use async_task::{Runnable, spawn};
///
/// let (runnable, task) = spawn(async {}, |_| {});
/// let runnable_pointer = runnable.into_raw();
///
Expand All @@ -880,7 +880,7 @@ impl<M> Runnable<M> {
/// }
/// // The memory was freed when `x` went out of scope above, so `runnable_pointer` is now dangling!
/// ```
///
/// [into_raw]: #method.into_raw
pub unsafe fn from_raw(ptr: NonNull<()>) -> Self {
Self {
Expand Down

0 comments on commit 419aa39

Please sign in to comment.