Skip to content

Commit fd18eb9

Browse files
committed
docs: fixes for doctests as of rust 1.89
1 parent e31386a commit fd18eb9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/http/server.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//! using the [`http_server`] macro:
66
//!
77
//! ```no_run
8+
//! # use wstd::http::{Request, Response, IntoBody, server::{Finished, Responder}, body::IncomingBody};
89
//! #[wstd::http_server]
910
//! async fn main(request: Request<IncomingBody>, responder: Responder) -> Finished {
1011
//! responder
@@ -49,7 +50,7 @@ impl Responder {
4950
/// # Example
5051
///
5152
/// ```
52-
/// # use wstd::http::{body::IncomingBody, BodyForthcoming, Response, Request};
53+
/// # use wstd::http::{body::{IncomingBody, BodyForthcoming}, Response, Request};
5354
/// # use wstd::http::server::{Finished, Responder};
5455
/// # use crate::wstd::io::AsyncWrite;
5556
/// # async fn example(responder: Responder) -> Finished {
@@ -59,6 +60,7 @@ impl Responder {
5960
/// .await;
6061
/// Finished::finish(body, result, None)
6162
/// # }
63+
/// # fn main() {}
6264
/// ```
6365
pub fn start_response(self, response: Response<BodyForthcoming>) -> OutgoingBody {
6466
let wasi_headers = header_map_to_wasi(response.headers()).expect("header error");
@@ -87,14 +89,15 @@ impl Responder {
8789
/// # Example
8890
///
8991
/// ```
90-
/// # use wstd::http::{body::IncomingBody, BodyForthcoming, IntoBody, Response, Request};
92+
/// # use wstd::http::{body::{IncomingBody, BodyForthcoming}, IntoBody, Response, Request};
9193
/// # use wstd::http::server::{Finished, Responder};
9294
/// #
9395
/// # async fn example(responder: Responder) -> Finished {
9496
/// responder
9597
/// .respond(Response::new("Hello!\n".into_body()))
9698
/// .await
9799
/// # }
100+
/// # fn main() {}
98101
/// ```
99102
pub async fn respond<B: Body>(self, response: Response<B>) -> Finished {
100103
let headers = response.headers();

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//!
2424
//! **HTTP Client**
2525
//!
26-
//! ```rust,no_run
26+
//! ```rust,ignore
2727
#![doc = include_str!("../tests/http_get.rs")]
2828
//! ```
2929
//!

0 commit comments

Comments
 (0)