diff --git a/src/fs/mod.rs b/src/fs/mod.rs new file mode 100644 index 000000000..ae19fccd9 --- /dev/null +++ b/src/fs/mod.rs @@ -0,0 +1,3 @@ +mod serve_dir; + +pub(crate) use serve_dir::ServeDir; diff --git a/src/server/serve_dir.rs b/src/fs/serve_dir.rs similarity index 100% rename from src/server/serve_dir.rs rename to src/fs/serve_dir.rs diff --git a/src/lib.rs b/src/lib.rs index 169e6de23..745afbf45 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -187,9 +187,11 @@ mod cookies; mod endpoint; +mod fs; mod middleware; mod request; mod response; +mod route; mod router; mod server; mod utils; @@ -198,23 +200,17 @@ pub mod log; pub mod prelude; pub mod redirect; pub mod security; - -pub use endpoint::Endpoint; -pub use request::Request; pub mod sse; -#[doc(inline)] -pub use http_types::{Body, Error, Status, StatusCode}; - -#[doc(inline)] +pub use endpoint::Endpoint; pub use middleware::{Middleware, Next}; -#[doc(inline)] +pub use request::Request; pub use response::Response; -#[doc(inline)] -pub use server::{Route, Server}; +pub use route::Route; +pub use server::Server; #[doc(inline)] -pub use http_types as http; +pub use http_types::{self as http, Body, Error, Status, StatusCode}; /// Create a new Tide server. /// diff --git a/src/server/route.rs b/src/route.rs similarity index 99% rename from src/server/route.rs rename to src/route.rs index 102cc41b1..39d8ccc70 100644 --- a/src/server/route.rs +++ b/src/route.rs @@ -3,8 +3,8 @@ use std::io; use std::path::Path; use std::sync::Arc; -use super::serve_dir::ServeDir; use crate::endpoint::MiddlewareEndpoint; +use crate::fs::ServeDir; use crate::log; use crate::utils::BoxFuture; use crate::{router::Router, Endpoint, Middleware}; diff --git a/src/server/mod.rs b/src/server.rs similarity index 99% rename from src/server/mod.rs rename to src/server.rs index c0f109982..71ebd6102 100644 --- a/src/server/mod.rs +++ b/src/server.rs @@ -15,12 +15,7 @@ use crate::log; use crate::middleware::{Middleware, Next}; use crate::router::{Router, Selection}; use crate::utils::BoxFuture; -use crate::{Endpoint, Request}; - -mod route; -mod serve_dir; - -pub use route::Route; +use crate::{Endpoint, Request, Route}; /// An HTTP server. ///