fix doctest

This commit is contained in:
DarkCat09 2024-08-29 13:39:08 +04:00
parent a77c3d89c8
commit 44d7461ea2
Signed by: DarkCat09
GPG key ID: BD3CE9B65916CD82

View file

@ -33,14 +33,17 @@ impl<IO: AsyncReadExt + Unpin> Response<IO> {
///
/// # Examples
/// ```
/// # async fn req(client: tokio_gemini::Client) -> Result<(), tokio_gemini::LibError> {
/// match client.request("gemini://dc09.ru").await?.ensure_ok() {
/// Ok(resp) => {
/// Ok(mut resp) => {
/// println!("{}", resp.text().await?);
/// }
/// Err(resp) => {
/// println!("{}", resp.message());
/// }
/// }
/// # Ok(())
/// # }
/// ```
pub fn ensure_ok(self) -> Result<Self, Self> {
if self.status.reply_type() == ReplyType::Success {