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 /// # Examples
/// ``` /// ```
/// # async fn req(client: tokio_gemini::Client) -> Result<(), tokio_gemini::LibError> {
/// match client.request("gemini://dc09.ru").await?.ensure_ok() { /// match client.request("gemini://dc09.ru").await?.ensure_ok() {
/// Ok(resp) => { /// Ok(mut resp) => {
/// println!("{}", resp.text().await?); /// println!("{}", resp.text().await?);
/// } /// }
/// Err(resp) => { /// Err(resp) => {
/// println!("{}", resp.message()); /// println!("{}", resp.message());
/// } /// }
/// } /// }
/// # Ok(())
/// # }
/// ``` /// ```
pub fn ensure_ok(self) -> Result<Self, Self> { pub fn ensure_ok(self) -> Result<Self, Self> {
if self.status.reply_type() == ReplyType::Success { if self.status.reply_type() == ReplyType::Success {