Skip to content

Commit

Permalink
feat: in-manifest and in-lib feature documentation (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Feb 6, 2022
1 parent 72b97f2 commit 5c573bf
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 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.

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

### git-actor

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

### git-features

Expand Down Expand Up @@ -178,11 +178,7 @@ be selected.

### git-object

* **verbose-object-parsing-errors**
- When parsing objects by default errors will only be available on the granularity of success or failure, and with the above flag enabled
details information about the error location will be collected.
- Use it in applications which expect broken or invalid objects or for debugging purposes. Incorrectly formatted objects aren't at all
common otherwise.
Documented in [its documentation](https://docs.rs/git-object).

### git-repository

Expand Down
14 changes: 11 additions & 3 deletions git-object/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ doctest = false
[features]
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
serde1 = ["serde", "bstr/serde1", "smallvec/serde", "git-hash/serde1", "git-actor/serde1"]
## When parsing objects by default errors will only be available on the granularity of success or failure, and with the above flag enabled
## details information about the error location will be collected.
## Use it in applications which expect broken or invalid objects or for debugging purposes. Incorrectly formatted objects aren't at all
## common otherwise.
verbose-object-parsing-errors = ["nom/std"]

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

[dependencies]
git-features = { version = "^0.19.1", path = "../git-features", features = ["rustsha1"] }
git-hash = { version = "^0.9.2", path = "../git-hash" }
Expand All @@ -34,6 +35,13 @@ nom = { version = "7", default-features = false, features = ["std"]}
smallvec = { version = "1.4.0", features = ["write"] }
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}

document-features = { version = "0.1", optional = true }

[dev-dependencies]
pretty_assertions = "1.0.0"
git-testtools = { path = "../tests/tools"}

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

5 changes: 5 additions & 0 deletions git-object/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
//! This crate provides types for [read-only git objects][crate::ObjectRef] backed by bytes provided in git's serialization format
//! as well as [mutable versions][Object] of these. Both types of objects can be encoded.
//! ## Feature Flags
#![cfg_attr(
feature = "document-features",
cfg_attr(doc, doc = ::document_features::document_features!())
)]
#![forbid(unsafe_code)]
#![deny(rust_2018_idioms, missing_docs)]

Expand Down

0 comments on commit 5c573bf

Please sign in to comment.