Skip to content

Commit

Permalink
Revert "slim down required dependency tree"
Browse files Browse the repository at this point in the history
This reverts commit 7f0c3e0.

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.
  • Loading branch information
bradfier committed Oct 12, 2022
1 parent 5d989c8 commit 017503e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 25 deletions.
16 changes: 6 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/content_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 0 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 017503e

Please sign in to comment.