Patch-Source: https://github.com/ducaale/xh/pull/282 -- From f7a51c7b2bf423c92a5f133455d4010fce2923af Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Mon, 26 Sep 2022 02:05:41 +0200 Subject: [PATCH 1/3] enable syntect features correctly for runtime and build time This is preparation for enabling cargo feature resolver "2". --- Cargo.toml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b0ebbb3f..bc71f07b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,11 @@ features = ["rustls-tls", "rustls-tls-webpki-roots", "rustls-tls-native-roots", [dependencies.syntect] version = "4.4" default-features = false +features = ["parsing", "html", "dump-load", "regex-onig"] + +[build-dependencies.syntect] +version = "4.4" +default-features = false features = ["parsing", "html", "yaml-load", "dump-load", "dump-create", "regex-onig"] [dev-dependencies] @@ -65,9 +70,6 @@ hyper = { version = "0.14", features = ["server"] } tokio = { version = "1", features = ["rt", "sync", "time"] } tempfile = "3.2.0" -[build-dependencies] -syntect = { version = "4.4", default-features = false } - [features] default = ["online-tests"] online-tests = [] From 300923c6e40632a954cdfbc0643b29a42f8424cb Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Mon, 26 Sep 2022 02:12:31 +0200 Subject: [PATCH 2/3] enable cargo feature resolver "2" xh currently uses the legacy resolver "1". The new one is used by default if the root package specifies 'edition = 2021', which xh does not (yet). The problem with the legacy resolver is, among others, that features enabled by {build,dev}-dependencies are propagated to normal dependencies. --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index bc71f07b..2cc9899a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ name = "xh" version = "0.16.1" authors = ["ducaale "] edition = "2018" +resolver = "2" license = "MIT" description = "Friendly and fast tool for sending HTTP requests" documentation = "https://github.com/ducaale/xh" From b2fe637363218771e54cc007aeb56a5560cdd9e6 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Mon, 26 Sep 2022 02:20:53 +0200 Subject: [PATCH 3/3] disable unnecessary/unused regex features To reduce the size of xh binary. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 2cc9899a..c0a4ba23 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ once_cell = "1.8.0" os_display = "0.1.3" pem = "0.8.2" rand = "0.8.3" -regex = "1" +regex = { version = "1", default-features = false, features = ["std"] } rpassword = "5.0.0" serde = "1.0" serde_json = { version = "1.0", features = ["preserve_order"] }