Skip to content

Commit

Permalink
feat: in-manifest and in-lib documentation of feature toggles (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Feb 6, 2022
1 parent 39778fd commit 1620830
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions cargo-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,8 @@ The library powering the command-line interface.

### git-pack

* **pack-cache-lru-static**
* Provide a fixed-size allocation-free LRU cache for packs. It's useful if caching is desired while keeping the memory footprint
for the LRU-cache itself low.
* **pack-cache-lru-dynamic**
* Provide a hash-map based LRU cache whose eviction is based a memory cap calculated from object data.
* **object-cache-dynamic**
* If set, select algorithms may additionally use a full-object cache which is queried before the pack itself.

Documented in [its documentation](https://docs.rs/git-pack).

### git-actor

Documented in [its documentation](https://docs.rs/git-actor).
Expand Down
15 changes: 12 additions & 3 deletions git-pack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ include = ["src/**/*", "CHANGELOG.md"]
doctest = false

[features]

## Provide a fixed-size allocation-free LRU cache for packs. It's useful if caching is desired while keeping the memory footprint
## for the LRU-cache itself low.
pack-cache-lru-static = ["uluru"]
## Provide a hash-map based LRU cache whose eviction is based a memory cap calculated from object data.
pack-cache-lru-dynamic = ["clru"]
## If set, select algorithms may additionally use a full-object cache which is queried before the pack itself.
object-cache-dynamic = ["clru"]
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
serde1 = ["serde", "git-object/serde1"]

internal-testing-git-features-parallel = ["git-features/parallel"]
internal-testing-to-avoid-being-run-by-cargo-test-all = []

Expand All @@ -30,9 +36,6 @@ name = "single-threaded"
path = "tests/pack-single-threaded.rs"
required-features = ["internal-testing-to-avoid-being-run-by-cargo-test-all"]

[package.metadata.docs.rs]
all-features = true

[dependencies]
git-features = { version = "^0.19.1", path = "../git-features", features = ["crc32", "rustsha1", "progress", "zlib"] }
git-hash = { version = "^0.9.2", path = "../git-hash" }
Expand All @@ -52,10 +55,16 @@ thiserror = "1.0.26"
uluru = { version = "3.0.0", optional = true }
clru = { version = "0.5.0", optional = true }
dashmap = "4.0.0" # # Wait for https://github.com/xacrimon/dashmap/issues/167 before upgrade (for performance)
document-features = { version = "0.1.0", optional = true }

[dev-dependencies]
git-testtools = { path = "../tests/tools"}
git-odb = { path = "../git-odb" }
tempfile = "3.1.0"
bstr = { version = "0.2.13", default-features = false, features = ["std"] }
common_macros = "0.1.1"

[package.metadata.docs.rs]
features = ["document-features"]
all-features = true

5 changes: 5 additions & 0 deletions git-pack/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
//!
//! When traversing all objects in a pack, a _delta tree acceleration structure_ can be built from pack data or an index
//! in order to decompress packs in parallel and without any waste.
//! ## Feature Flags
#![cfg_attr(
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]

///
pub mod bundle;
Expand Down

0 comments on commit 1620830

Please sign in to comment.