From 8ba781f8ffd891b1d8ca102a811e6b612eded285 Mon Sep 17 00:00:00 2001 From: Jerboa-app Date: Fri, 5 Jan 2024 08:51:51 +0000 Subject: [PATCH] fix doc --- src/discord/post.rs | 5 ++++- src/web/response/github_verify.rs | 3 +-- src/web/response/util.rs | 7 +++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/discord/post.rs b/src/discord/post.rs index 74fcf23..f000903 100644 --- a/src/discord/post.rs +++ b/src/discord/post.rs @@ -14,7 +14,10 @@ use crate::discord::model::Webhook; /// /// # Example /// ```rust -/// pub async fn foo(){ +/// +/// use pulse::discord::{model::Webhook, post::post}; +/// +/// pub async fn post_to_discord(){ /// let w = Webhook::new("https://discord.com/api/webhooks/xxx/yyy".to_string()); /// post(w, "this is some plaintext".to_string()); /// } diff --git a/src/web/response/github_verify.rs b/src/web/response/github_verify.rs index e55173a..7290606 100644 --- a/src/web/response/github_verify.rs +++ b/src/web/response/github_verify.rs @@ -66,8 +66,7 @@ pub fn read_bytes(v: String) -> Vec /// /// use pulse::web::response::github_verify::github_verify; /// -/// #[tokio::main] -/// pub async fn main() { +/// pub async fn server() { /// let authenticated_state = "this_is_a_secret".to_string(); /// /// let app = Router::new() diff --git a/src/web/response/util.rs b/src/web/response/util.rs index 7c89b4f..7e45892 100644 --- a/src/web/response/util.rs +++ b/src/web/response/util.rs @@ -30,8 +30,7 @@ use chrono::Local; /// /// use pulse::web::response::util::reflect; /// -/// #[tokio::main] -/// pub async fn main() { +/// pub async fn server() { /// let app = Router::new() /// .route("/", post(|| async move { })) /// .layer(middleware::from_fn(reflect)); @@ -88,8 +87,8 @@ where B: axum::body::HttpBody /// /// use pulse::web::response::util::stdout_log; /// -/// #[tokio::main] -/// pub async fn main() { +/// +/// pub async fn server() { /// let app = Router::new() /// .route("/", post(|| async move { })) /// .layer(middleware::from_fn(stdout_log));