Commit
Author: Kevin Schoon [me@kevinschoon.com]
Hash: 49e8ffc26245b5bb2c764053f77ec29794b829a0
Timestamp: Thu, 24 Oct 2024 23:03:38 +0000 (5 days ago)

+4 -2 +/-2 browse
Feature gate report module
Feature gate report module

Put the report module behind a feature gate. One practical reason for doing
this is that the quick-xml package explicitly disables non-utf8 support
without enabling the encoding feature. Other packages that depend on quick-xml
like RSS libraries often need support for non-utf8 encoding and this creates
a compile time error.
1diff --git a/Cargo.toml b/Cargo.toml
2index b21deeb..de6a30b 100644
3--- a/Cargo.toml
4+++ b/Cargo.toml
5 @@ -16,9 +16,10 @@ resolver = "2"
6 doctest = false
7
8 [features]
9- default = ["ring", "rustls-pemfile"]
10+ default = ["ring", "rustls-pemfile", "report"]
11 rust-crypto = ["ed25519-dalek", "rsa", "sha1", "sha2"]
12 generate = ["rsa", "rand"]
13+ report = ["quick-xml"]
14 test = []
15
16 [dependencies]
17 @@ -29,7 +30,7 @@ lru-cache = "0.1.2"
18 mail-parser = { version = "0.9", features = ["ludicrous_mode", "full_encoding"] }
19 mail-builder = { version = "0.3", features = ["ludicrous_mode"] }
20 parking_lot = "0.12.0"
21- quick-xml = "0.36"
22+ quick-xml = { version = "0.36", optional = true }
23 ring = { version = "0.17", optional = true }
24 rsa = { version = "0.9.6", optional = true }
25 rustls-pemfile = { version = "2", optional = true }
26 diff --git a/src/lib.rs b/src/lib.rs
27index 67ad4b6..95f904b 100644
28--- a/src/lib.rs
29+++ b/src/lib.rs
30 @@ -36,6 +36,7 @@ pub mod common;
31 pub mod dkim;
32 pub mod dmarc;
33 pub mod mta_sts;
34+ #[cfg(feature = "report")]
35 pub mod report;
36 pub mod spf;
37