From 4d3a53455839b4835408b0da3c4cd14bc3eaef20 Mon Sep 17 00:00:00 2001 From: Vitor Enes Date: Fri, 25 Aug 2023 12:33:08 +0100 Subject: [PATCH] Fix docs build (#1064) fix "Build docs" CI step. --- src/filters/any.rs | 2 +- src/filters/fs.rs | 2 +- src/filters/log.rs | 2 +- src/filters/reply.rs | 12 ++++++------ src/filters/sse.rs | 4 +++- src/filters/trace.rs | 2 +- src/filters/ws.rs | 2 +- src/lib.rs | 2 +- src/redirect.rs | 2 +- src/test.rs | 2 +- 10 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/filters/any.rs b/src/filters/any.rs index 707fd82dd..2b21b8c5e 100644 --- a/src/filters/any.rs +++ b/src/filters/any.rs @@ -9,7 +9,7 @@ use crate::filter::{Filter, FilterBase, Internal}; /// A filter that matches any route. /// /// This can be a useful building block to build new filters from, -/// since [`Filter`](crate::Filter) is otherwise a sealed trait. +/// since [`Filter`] is otherwise a sealed trait. /// /// # Example /// diff --git a/src/filters/fs.rs b/src/filters/fs.rs index 0949b66ec..fdfa70968 100644 --- a/src/filters/fs.rs +++ b/src/filters/fs.rs @@ -37,7 +37,7 @@ use crate::reply::{Reply, Response}; /// filters, such as after validating in `POST` request, wanting to return a /// specific file as the body. /// -/// For serving a directory, see [dir](dir). +/// For serving a directory, see [dir]. /// /// # Example /// diff --git a/src/filters/log.rs b/src/filters/log.rs index eae597402..1f93ab7d7 100644 --- a/src/filters/log.rs +++ b/src/filters/log.rs @@ -77,7 +77,7 @@ where Log { func } } -/// Decorates a [`Filter`](crate::Filter) to log requests and responses. +/// Decorates a [`Filter`] to log requests and responses. #[derive(Clone, Copy, Debug)] pub struct Log { func: F, diff --git a/src/filters/reply.rs b/src/filters/reply.rs index c4c37bbd8..42b661d3e 100644 --- a/src/filters/reply.rs +++ b/src/filters/reply.rs @@ -28,12 +28,12 @@ use self::sealed::{WithDefaultHeader_, WithHeader_, WithHeaders_}; use crate::filter::{Filter, Map, WrapSealed}; use crate::reply::Reply; -/// Wrap a [`Filter`](crate::Filter) that adds a header to the reply. +/// Wrap a [`Filter`] that adds a header to the reply. /// /// # Note /// /// This **only** adds a header if the underlying filter is successful, and -/// returns a [`Reply`](Reply). If the underlying filter was rejected, the +/// returns a [`Reply`] If the underlying filter was rejected, the /// header is not added. /// /// # Example @@ -57,12 +57,12 @@ where WithHeader { name, value } } -/// Wrap a [`Filter`](crate::Filter) that adds multiple headers to the reply. +/// Wrap a [`Filter`] that adds multiple headers to the reply. /// /// # Note /// /// This **only** adds a header if the underlying filter is successful, and -/// returns a [`Reply`](Reply). If the underlying filter was rejected, the +/// returns a [`Reply`] If the underlying filter was rejected, the /// header is not added. /// /// # Example @@ -88,13 +88,13 @@ pub fn headers(headers: HeaderMap) -> WithHeaders { // pub fn headers? -/// Wrap a [`Filter`](crate::Filter) that adds a header to the reply, if they +/// Wrap a [`Filter`] that adds a header to the reply, if they /// aren't already set. /// /// # Note /// /// This **only** adds a header if the underlying filter is successful, and -/// returns a [`Reply`](Reply). If the underlying filter was rejected, the +/// returns a [`Reply`] If the underlying filter was rejected, the /// header is not added. /// /// # Example diff --git a/src/filters/sse.rs b/src/filters/sse.rs index 2fb9b7ef1..413456aab 100644 --- a/src/filters/sse.rs +++ b/src/filters/sse.rs @@ -39,6 +39,8 @@ //! which specifies the expected behavior of Server Sent Events. //! +#![allow(rustdoc::invalid_html_tags)] + use serde::Serialize; use std::borrow::Cow; use std::error::Error as StdError; @@ -376,7 +378,7 @@ impl KeepAlive { /// Wrap an event stream with keep-alive functionality. /// - /// See [`keep_alive`](keep_alive) for more. + /// See [`keep_alive`] for more. pub fn stream( self, event_stream: S, diff --git a/src/filters/trace.rs b/src/filters/trace.rs index 5ca4e9df9..60686b430 100644 --- a/src/filters/trace.rs +++ b/src/filters/trace.rs @@ -123,7 +123,7 @@ pub fn named(name: &'static str) -> Trace) -> Span + Copy> { trace(move |_| tracing::debug_span!("context", "{}", name,)) } -/// Decorates a [`Filter`](crate::Filter) to create a [`tracing`] [span] for +/// Decorates a [`Filter`] to create a [`tracing`] [span] for /// requests and responses. /// /// [`tracing`]: https://crates.io/crates/tracing diff --git a/src/filters/ws.rs b/src/filters/ws.rs index 1e953c7a3..e5ae62c43 100644 --- a/src/filters/ws.rs +++ b/src/filters/ws.rs @@ -68,7 +68,7 @@ pub fn ws() -> impl Filter, Error = Rejection> + Copy { ) } -/// Extracted by the [`ws`](ws) filter, and used to finish an upgrade. +/// Extracted by the [`ws`] filter, and used to finish an upgrade. pub struct Ws { config: Option, key: SecWebsocketKey, diff --git a/src/lib.rs b/src/lib.rs index f20e67c10..6bc4cf0c9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,7 +81,7 @@ //! ## Testing //! //! Testing your web services easily is extremely important, and warp provides -//! a [`test`](self::test) module to help send mocked requests through your service. +//! a [`test`](mod@self::test) module to help send mocked requests through your service. //! //! [Filter]: trait.Filter.html //! [reject]: reject/index.html diff --git a/src/redirect.rs b/src/redirect.rs index 6e3746ab7..373ab546f 100644 --- a/src/redirect.rs +++ b/src/redirect.rs @@ -1,6 +1,6 @@ //! Redirect requests to a new location. //! -//! The types in this module are helpers that implement [`Reply`](Reply), and easy +//! The types in this module are helpers that implement [`Reply`], and easy //! to use in order to setup redirects. use http::{header, StatusCode}; diff --git a/src/test.rs b/src/test.rs index 3c67c34d8..ca2710fae 100644 --- a/src/test.rs +++ b/src/test.rs @@ -366,7 +366,7 @@ impl RequestBuilder { /// Returns `Response` provided by applying the `Filter`. /// - /// This requires that the supplied `Filter` return a [`Reply`](Reply). + /// This requires that the supplied `Filter` return a [`Reply`]. pub async fn reply(self, f: &F) -> Response where F: Filter + 'static,