Skip to content
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

Explain why len and is_empty can be None in Body #526

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
})
}

/// Get the length of the body in bytes.
/// Get the length of the body in bytes if defined. [None] if not.
///
/// # Examples
///
Expand All @@ -468,7 +468,7 @@
self.length
}

/// Returns `true` if the body has a length of zero, and `false` otherwise.
/// Returns `true` if the body has a length of zero, and `false` otherwise if length is defined. [None] if not.
pub fn is_empty(&self) -> Option<bool> {
self.length.map(|length| length == 0)
}
Expand Down Expand Up @@ -578,7 +578,7 @@
}

impl AsyncRead for Body {
#[allow(rustdoc::missing_doc_code_examples)]

Check warning on line 581 in src/body.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, nightly)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 581 in src/body.rs

View workflow job for this annotation

GitHub Actions / Build and test (macOS-latest, nightly)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 581 in src/body.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, stable)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 581 in src/body.rs

View workflow job for this annotation

GitHub Actions / Build and test (macOS-latest, stable)

unknown lint: `rustdoc::missing_doc_code_examples`
fn poll_read(
mut self: Pin<&mut Self>,
cx: &mut Context<'_>,
Expand All @@ -602,7 +602,7 @@
}

impl AsyncBufRead for Body {
#[allow(rustdoc::missing_doc_code_examples)]

Check warning on line 605 in src/body.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, nightly)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 605 in src/body.rs

View workflow job for this annotation

GitHub Actions / Build and test (macOS-latest, nightly)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 605 in src/body.rs

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, stable)

unknown lint: `rustdoc::missing_doc_code_examples`

Check warning on line 605 in src/body.rs

View workflow job for this annotation

GitHub Actions / Build and test (macOS-latest, stable)

unknown lint: `rustdoc::missing_doc_code_examples`
fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<&'_ [u8]>> {
self.project().reader.poll_fill_buf(cx)
}
Expand Down
Loading