Skip to content

Commit

Permalink
doc: switch to using document-feature for genearating feature flag …
Browse files Browse the repository at this point in the history
…documentation
  • Loading branch information
pfernie committed Oct 8, 2024
1 parent ff51434 commit 9645dd5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 34 deletions.
18 changes: 13 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,35 @@ rustdoc-args = ["--cfg", "docsrs"]
[features]
default = ["public_suffix", "serde_json"]

# uses `indexmap::IndexMap` in lieu of HashMap internally, so cookies are maintained in insertion/creation order
## uses `indexmap::IndexMap` in lieu of HashMap internally, so cookies are maintained in insertion/creation order
preserve_order = ["dep:indexmap"]
## Add support for public suffix lists, as provided by [publicsuffix](https://crates.io/crates/publicsuffix).
public_suffix = ["dep:publicsuffix"]
## Enables transitive feature `time/wasm-bindgen`; necessary in `wasm` contexts.
wasm-bindgen = ["time/wasm-bindgen"]

## Enable logging the values of cookies marked 'secure', off by default as values may be sensitive
log_secure_cookie_values = []

#! ### Serialization
## Supports generic (format-agnostic) de/serialization for a `CookieStore`. Adds dependencies `serde` and `serde_derive`.
serde = ["dep:serde", "dep:serde_derive"]
## Supports de/serialization for a `CookieStore` via the JSON format. Enables feature `serde` and adds depenency `serde_json`.
serde_json = ["serde", "dep:serde_json"]
## Supports de/serialization for a `CookieStore` via the RON format. Enables feature `serde` and adds depenency `ron`.
serde_ron = ["serde", "dep:ron"]

# Enable logging the values of cookies marked 'secure', off by default as values may be sensitive
log_secure_cookie_values = []

[dependencies]
document-features = "0.2.10"
idna = "0.5.0"
log = "0.4.17"
publicsuffix = { version = "2.2.3", optional = true }
time = "0.3.16"
url = "2.3.1"

indexmap = { version = "2.0.0", optional = true }

publicsuffix = { version = "2.2.3", optional = true }

# serialization dependencies
serde = { version = "1.0.147", optional = true }
serde_derive = { version = "1.0.147", optional = true }
Expand Down
31 changes: 2 additions & 29 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,8 @@
//! Please refer to the [reqwest_cookie_store](https://crates.io/crates/reqwest_cookie_store) for
//! an example of using this library along with [reqwest](https://crates.io/crates/reqwest).
//!
//! # Feature flags
//!
//! ## `default`
//! Default features: `[public_suffix, serde_json]`.
//!
//! ## `preserve_order`
//! If enabled, [`CookieStore`] will use [`indexmap::IndexMap`] internally, and [`Cookie`]
//! insertion order will be preserved. Adds dependency `indexmap`.
//!
//! ## `public_suffix`
//! __Enabled by default__. Add support for public suffix lists, as provided by
//! [publicsuffix](https://crates.io/crates/publicsuffix).
//!
//! ## `wasm-bindgen`
//! Enabled transitive feature `time/wasm-bindgen`; necessary in `wasm` contexts.
//!
//! ## `serde`
//! Supports generic (format-agnostic) de/serialization for a `CookieStore`. Adds dependencies `serde` and `serde_derive`.
//!
//! ## `serde_json`
//! __Enabled by default__. Supports de/serialization for a `CookieStore` via the JSON format. Enables
//! feature `serde` and adds depenency `serde_json`.
//!
//! ## `serde_ron`
//! Supports de/serialization for a `CookieStore` via the RON format. Enables
//! feature `serde` and adds depenency `ron`.
//!
//! ## `log_secure_cookie_values`
//! Enable logging the values of cookies marked 'secure', off by default as values may be sensitive
//! ## Feature flags
#![doc = document_features::document_features!()]

use idna;

Expand Down

0 comments on commit 9645dd5

Please sign in to comment.