Skip to content

CI: fix rust-toolchain.toml and doctests #79

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.82.0"
channel = "stable"
targets = ["wasm32-wasip2"]
7 changes: 5 additions & 2 deletions src/http/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! using the [`http_server`] macro:
//!
//! ```no_run
//! # use wstd::http::{Request, Response, IntoBody, server::{Finished, Responder}, body::IncomingBody};
//! #[wstd::http_server]
//! async fn main(request: Request<IncomingBody>, responder: Responder) -> Finished {
//! responder
Expand Down Expand Up @@ -49,7 +50,7 @@ impl Responder {
/// # Example
///
/// ```
/// # use wstd::http::{body::IncomingBody, BodyForthcoming, Response, Request};
/// # use wstd::http::{body::{IncomingBody, BodyForthcoming}, Response, Request};
/// # use wstd::http::server::{Finished, Responder};
/// # use crate::wstd::io::AsyncWrite;
/// # async fn example(responder: Responder) -> Finished {
Expand All @@ -59,6 +60,7 @@ impl Responder {
/// .await;
/// Finished::finish(body, result, None)
/// # }
/// # fn main() {}
/// ```
pub fn start_response(self, response: Response<BodyForthcoming>) -> OutgoingBody {
let wasi_headers = header_map_to_wasi(response.headers()).expect("header error");
Expand Down Expand Up @@ -87,14 +89,15 @@ impl Responder {
/// # Example
///
/// ```
/// # use wstd::http::{body::IncomingBody, BodyForthcoming, IntoBody, Response, Request};
/// # use wstd::http::{body::{IncomingBody, BodyForthcoming}, IntoBody, Response, Request};
/// # use wstd::http::server::{Finished, Responder};
/// #
/// # async fn example(responder: Responder) -> Finished {
/// responder
/// .respond(Response::new("Hello!\n".into_body()))
/// .await
/// # }
/// # fn main() {}
/// ```
pub async fn respond<B: Body>(self, response: Response<B>) -> Finished {
let headers = response.headers();
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//!
//! **HTTP Client**
//!
//! ```rust,no_run
//! ```rust,ignore
#![doc = include_str!("../tests/http_get.rs")]
//! ```
//!
Expand Down
Loading