Skip to content

Commit

Permalink
fix missing_docs warning for cfg(all(loom, test)) functions
Browse files Browse the repository at this point in the history
```
error: missing documentation for an associated function
   --> src/bytes.rs:146:5
    |
146 |     pub fn new() -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^
    |
    = note: `-D missing-docs` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(missing_docs)]`

error: missing documentation for an associated function
   --> src/bytes.rs:176:5
    |
176 |     pub fn from_static(bytes: &'static [u8]) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
  • Loading branch information
taiki-e committed Sep 15, 2024
1 parent 8e4b018 commit 9559b48
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ impl Bytes {
Bytes::from_static(EMPTY)
}

/// Creates a new empty `Bytes`.
#[cfg(all(loom, test))]
pub fn new() -> Self {
const EMPTY: &[u8] = &[];
Expand Down Expand Up @@ -172,6 +173,7 @@ impl Bytes {
}
}

/// Creates a new `Bytes` from a static slice.
#[cfg(all(loom, test))]
pub fn from_static(bytes: &'static [u8]) -> Self {
Bytes {
Expand Down

0 comments on commit 9559b48

Please sign in to comment.