From 281f6532ef7c6508943569324f9f27c94e5f5047 Mon Sep 17 00:00:00 2001 From: Fangdun Tsai Date: Mon, 1 Jan 2024 06:04:34 +0800 Subject: [PATCH] fix: doc tests --- viz/Cargo.toml | 7 ++++--- viz/src/lib.rs | 3 +-- viz/src/server.rs | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/viz/Cargo.toml b/viz/Cargo.toml index 4ecf8f32..8f3190ac 100644 --- a/viz/Cargo.toml +++ b/viz/Cargo.toml @@ -64,8 +64,8 @@ otel-tracing = ["otel", "viz-core/otel-tracing"] otel-metrics = ["otel", "viz-core/otel-metrics"] otel-prometheus = ["handlers", "viz-handlers?/prometheus"] -rustls = ["dep:rustls-pemfile", "dep:tokio-rustls"] -native-tls = ["dep:tokio-native-tls"] +rustls = ["dep:rustls-pemfile", "dep:tokio-rustls", "dep:futures-util"] +native-tls = ["dep:tokio-native-tls", "dep:futures-util"] [dependencies] viz-core.workspace = true @@ -75,7 +75,8 @@ viz-macros = { workspace = true, optional = true } hyper.workspace = true hyper-util.workspace = true -futures-util.workspace = true + +futures-util = { workspace = true, optional = true } rustls-pemfile = { workspace = true, optional = true } diff --git a/viz/src/lib.rs b/viz/src/lib.rs index ddcec1b4..2d8e2178 100644 --- a/viz/src/lib.rs +++ b/viz/src/lib.rs @@ -222,9 +222,8 @@ //! ``` //! # use std::time::Duration; //! # use viz::{ -//! # get, types::Params, Transform, HandlerExt, IntoResponse, IntoHandler, +//! # async_trait, get, types::Params, Transform, HandlerExt, IntoResponse, IntoHandler, //! # Request, Response, ResponseExt, Result, Router, StatusCode, Next, Handler, -//! # future::BoxFuture, //! # }; //! async fn index(_: Request) -> Result { //! Ok(StatusCode::OK.into_response()) diff --git a/viz/src/server.rs b/viz/src/server.rs index ac3999d0..2ec31a81 100644 --- a/viz/src/server.rs +++ b/viz/src/server.rs @@ -6,7 +6,6 @@ use std::{ sync::Arc, }; -use futures_util::FutureExt; use hyper_util::{ rt::{TokioExecutor, TokioIo}, server::conn::auto::Builder, @@ -17,7 +16,7 @@ use tokio::{ sync::watch, }; -use crate::{Responder, Router, Tree}; +use crate::{future::FutureExt, Responder, Router, Tree}; mod accept; pub use accept::Accept;