From 017503e09b2e3fdc837ab5551d64e0eaebcaa24e Mon Sep 17 00:00:00 2001 From: Richard Bradfield Date: Wed, 12 Oct 2022 16:31:03 +0100 Subject: [PATCH] Revert "slim down required dependency tree" This reverts commit 7f0c3e0889c4d248d8d07b462a5678b40642f93b. Moving types behind a feature flag is a breaking change even if those flags are included in the `default` features array. This change will require a 4.x.x release. --- Cargo.toml | 16 ++++++---------- src/content_encoding.rs | 4 ++-- src/input/mod.rs | 2 -- src/lib.rs | 11 ----------- 4 files changed, 8 insertions(+), 25 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 225a4a02a..13218c64f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,29 +11,25 @@ keywords = ["web", "framework", "http", "rest"] categories = ["web-programming::http-server", "web-programming::websocket"] [features] -default = ["gzip", "brotli", "logging", "assets", "post", "session"] +default = ["gzip", "brotli"] gzip = ["deflate"] ssl = ["tiny_http/ssl"] rustls = ["tiny_http/ssl-rustls"] -logging = ["chrono"] -assets = ["filetime", "time"] -post = ["multipart"] -session = ["rand"] [dependencies] base64 = "0.13" brotli = { version = "3.3.2", optional = true } -chrono = { version = "0.4.19", optional = true, default-features = false, features = ["clock"] } -filetime = { version = "0.2.0", optional = true } +chrono = { version = "0.4.19", default-features = false, features = ["clock"] } +filetime = "0.2.0" deflate = { version = "1.0.0", optional = true, features = ["gzip"] } -multipart = { version = "0.18", optional = true, default-features = false, features = ["server"] } +multipart = { version = "0.18", default-features = false, features = ["server"] } percent-encoding = "2" -rand = { version = "0.8", optional = true } +rand = "0.8" serde = "1" serde_derive = "1" serde_json = "1" sha1 = "0.10.1" -time = { version = "0.3.15", optional = true, features = [ "local-offset" ] } +time = { version = "0.3.15", features = [ "local-offset" ] } tiny_http = { version = "0.12.0", default-features = false } url = "2" threadpool = "1" diff --git a/src/content_encoding.rs b/src/content_encoding.rs index a4ac63886..6b0f6e08b 100644 --- a/src/content_encoding.rs +++ b/src/content_encoding.rs @@ -128,7 +128,7 @@ fn gzip(response: &mut Response) { #[cfg(not(feature = "gzip"))] #[inline] -fn gzip(_: &mut Response) {} +fn gzip(response: &mut Response) {} #[cfg(feature = "brotli")] fn brotli(response: &mut Response) { @@ -147,7 +147,7 @@ fn brotli(response: &mut Response) { #[cfg(not(feature = "brotli"))] #[inline] -fn brotli(_: &mut Response) {} +fn brotli(response: &mut Response) {} #[cfg(test)] mod tests { diff --git a/src/input/mod.rs b/src/input/mod.rs index c32102ce2..9a95c0658 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -29,9 +29,7 @@ pub use self::priority_header::priority_header_preferred; pub use self::priority_header::PriorityHeaderIter; pub mod json; -#[cfg(feature = "post")] pub mod multipart; -#[cfg(feature = "post")] pub mod post; mod accept; diff --git a/src/lib.rs b/src/lib.rs index 9c6826151..9bf1bc433 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,15 +59,11 @@ extern crate base64; #[cfg(feature = "brotli")] extern crate brotli; -#[cfg(feature = "logging")] extern crate chrono; #[cfg(feature = "gzip")] extern crate deflate; -#[cfg(feature = "assets")] extern crate filetime; -#[cfg(feature = "post")] extern crate multipart; -#[cfg(feature = "session")] extern crate rand; extern crate serde; #[macro_use] @@ -77,7 +73,6 @@ pub extern crate percent_encoding; extern crate serde_json; extern crate sha1; extern crate threadpool; -#[cfg(feature = "assets")] extern crate time; extern crate tiny_http; pub extern crate url; @@ -94,11 +89,8 @@ pub const DEFAULT_ENCODE_SET: &percent_encoding::AsciiSet = &percent_encoding::C .add(b'{') .add(b'}'); -#[cfg(feature = "assets")] pub use assets::extension_to_mime; -#[cfg(feature = "assets")] pub use assets::match_assets; -#[cfg(feature = "logging")] pub use log::{log, log_custom}; pub use response::{Response, ResponseBody}; pub use tiny_http::ReadWrite; @@ -125,14 +117,11 @@ pub mod cgi; pub mod content_encoding; pub mod input; pub mod proxy; -#[cfg(feature = "session")] pub mod session; pub mod websocket; -#[cfg(feature = "assets")] mod assets; mod find_route; -#[cfg(feature = "logging")] mod log; mod response; mod router;