Replace RoutingDsl trait with Router type (#214)

* Remove `RoutingDsl`

* Fix typo
This commit is contained in:
David Pedersen
2021-08-19 21:24:32 +02:00
committed by GitHub
parent 0fd17d4181
commit 97b53768ba
45 changed files with 177 additions and 283 deletions
+3 -7
View File
@@ -1,6 +1,6 @@
//! [`Or`] used to combine two services into one.
use super::{FromEmptyRouter, OrDepth, RoutingDsl};
use super::{FromEmptyRouter, OrDepth};
use crate::body::BoxBody;
use futures_util::ready;
use http::{Request, Response};
@@ -14,19 +14,15 @@ use tower::{util::Oneshot, Service, ServiceExt};
/// [`tower::Service`] that is the combination of two routers.
///
/// See [`RoutingDsl::or`] for more details.
/// See [`Router::or`] for more details.
///
/// [`RoutingDsl::or`]: super::RoutingDsl::or
/// [`Router::or`]: super::Router::or
#[derive(Debug, Clone, Copy)]
pub struct Or<A, B> {
pub(super) first: A,
pub(super) second: B,
}
impl<A, B> RoutingDsl for Or<A, B> {}
impl<A, B> crate::sealed::Sealed for Or<A, B> {}
#[allow(warnings)]
impl<A, B, ReqBody> Service<Request<ReqBody>> for Or<A, B>
where