diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 421467d0b9b..c49221e4635 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,7 +172,7 @@ jobs: # Let's not fail CI for this, it will fail locally often enough, and a crate a little bigger # than allows is no problem either if it comes to that. just check-size || true - + cargo-deny: runs-on: ubuntu-latest strategy: diff --git a/Cargo.lock b/Cargo.lock index da15d6afc9a..419568e6f64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1652,6 +1652,7 @@ name = "gix-fs" version = "0.8.0" dependencies = [ "gix-features 0.36.0", + "serde", "tempfile", ] diff --git a/Cargo.toml b/Cargo.toml index 8bb402b772e..024f088e568 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -302,4 +302,3 @@ prodash = { version = "26.2.2", default-features = false } [package.metadata.docs.rs] features = ["document-features", "max"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gitoxide-core/Cargo.toml b/gitoxide-core/Cargo.toml index 32b017ba766..82ba7344d5e 100644 --- a/gitoxide-core/Cargo.toml +++ b/gitoxide-core/Cargo.toml @@ -93,4 +93,3 @@ document-features = { version = "0.2.0", optional = true } [package.metadata.docs.rs] features = ["document-features", "blocking-client", "organize", "estimate-hours", "serde"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gitoxide-core/src/lib.rs b/gitoxide-core/src/lib.rs index b4dc9da5365..2cf788a994a 100644 --- a/gitoxide-core/src/lib.rs +++ b/gitoxide-core/src/lib.rs @@ -22,10 +22,10 @@ //! //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![cfg_attr(feature = "async-client", allow(unused))] #![deny(rust_2018_idioms)] #![forbid(unsafe_code)] diff --git a/gix-actor/Cargo.toml b/gix-actor/Cargo.toml index 7a1e98bfc97..79f95c6b3cd 100644 --- a/gix-actor/Cargo.toml +++ b/gix-actor/Cargo.toml @@ -37,4 +37,3 @@ gix-hash = { path = "../gix-hash" } [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-actor/src/lib.rs b/gix-actor/src/lib.rs index 5a4d078be87..e582541cb1a 100644 --- a/gix-actor/src/lib.rs +++ b/gix-actor/src/lib.rs @@ -2,10 +2,10 @@ //! //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms)] #![forbid(unsafe_code)] diff --git a/gix-archive/Cargo.toml b/gix-archive/Cargo.toml index 346f4e59127..9e5628b277f 100644 --- a/gix-archive/Cargo.toml +++ b/gix-archive/Cargo.toml @@ -53,4 +53,3 @@ gix-filter = { path = "../gix-filter"} [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-archive/src/lib.rs b/gix-archive/src/lib.rs index 692e9564583..78e3b4f81ab 100644 --- a/gix-archive/src/lib.rs +++ b/gix-archive/src/lib.rs @@ -9,10 +9,10 @@ //! ## Feature Flags //! All features are related to which container formats are available. #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(rust_2018_idioms, missing_docs)] #![forbid(unsafe_code)] diff --git a/gix-attributes/Cargo.toml b/gix-attributes/Cargo.toml index 6818efb05c5..670e65212f4 100644 --- a/gix-attributes/Cargo.toml +++ b/gix-attributes/Cargo.toml @@ -37,5 +37,4 @@ gix-fs = { path = "../gix-fs" } [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] features = ["document-features"] diff --git a/gix-attributes/src/lib.rs b/gix-attributes/src/lib.rs index 7eaac428292..812ffe49a75 100644 --- a/gix-attributes/src/lib.rs +++ b/gix-attributes/src/lib.rs @@ -2,10 +2,10 @@ //! //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] pub use gix_glob as glob; diff --git a/gix-commitgraph/Cargo.toml b/gix-commitgraph/Cargo.toml index 380675844bf..a357618fbca 100644 --- a/gix-commitgraph/Cargo.toml +++ b/gix-commitgraph/Cargo.toml @@ -36,4 +36,3 @@ gix-date = { path = "../gix-date" } [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-commitgraph/src/lib.rs b/gix-commitgraph/src/lib.rs index d7fb23d38bc..d9f4d36bf2f 100644 --- a/gix-commitgraph/src/lib.rs +++ b/gix-commitgraph/src/lib.rs @@ -9,10 +9,10 @@ //! Eventually, git will merge these files together as the number of files grows. //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] use std::path::Path; diff --git a/gix-config-value/Cargo.toml b/gix-config-value/Cargo.toml index dbd716e4b64..db480abfa0f 100644 --- a/gix-config-value/Cargo.toml +++ b/gix-config-value/Cargo.toml @@ -32,4 +32,3 @@ libc = "0.2" [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-config-value/src/lib.rs b/gix-config-value/src/lib.rs index 5b4f3fa76c3..b3be069e328 100644 --- a/gix-config-value/src/lib.rs +++ b/gix-config-value/src/lib.rs @@ -2,10 +2,10 @@ //! //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] /// The error returned when any config value couldn't be instantiated due to malformed input. diff --git a/gix-config/Cargo.toml b/gix-config/Cargo.toml index 559b97e70d7..c08c7edd1a1 100644 --- a/gix-config/Cargo.toml +++ b/gix-config/Cargo.toml @@ -46,4 +46,3 @@ path = "./benches/large_config_file.rs" [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-config/src/lib.rs b/gix-config/src/lib.rs index a62163ac337..b1740cdd879 100644 --- a/gix-config/src/lib.rs +++ b/gix-config/src/lib.rs @@ -31,10 +31,10 @@ //! //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] pub mod file; diff --git a/gix-credentials/Cargo.toml b/gix-credentials/Cargo.toml index ceefa995efc..c46cbff1a35 100644 --- a/gix-credentials/Cargo.toml +++ b/gix-credentials/Cargo.toml @@ -40,4 +40,3 @@ gix-sec = { path = "../gix-sec" } [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-credentials/src/lib.rs b/gix-credentials/src/lib.rs index dfcb4ced76e..4e3e21d99a3 100644 --- a/gix-credentials/src/lib.rs +++ b/gix-credentials/src/lib.rs @@ -2,10 +2,10 @@ //! //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms)] #![forbid(unsafe_code)] diff --git a/gix-date/Cargo.toml b/gix-date/Cargo.toml index 0ff92d88c42..8f8cae5f324 100644 --- a/gix-date/Cargo.toml +++ b/gix-date/Cargo.toml @@ -33,4 +33,3 @@ gix-hash = { path = "../gix-hash" } [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-date/src/lib.rs b/gix-date/src/lib.rs index d71283f458c..0ada471473f 100644 --- a/gix-date/src/lib.rs +++ b/gix-date/src/lib.rs @@ -3,10 +3,10 @@ //! Note that this is not a general purpose time library. //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms)] #![forbid(unsafe_code)] diff --git a/gix-diff/Cargo.toml b/gix-diff/Cargo.toml index 589b3c34b2d..8889f53690b 100644 --- a/gix-diff/Cargo.toml +++ b/gix-diff/Cargo.toml @@ -37,4 +37,3 @@ document-features = { version = "0.2.0", optional = true } [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-diff/src/lib.rs b/gix-diff/src/lib.rs index b3a61b2b97b..abacca3b4e1 100644 --- a/gix-diff/src/lib.rs +++ b/gix-diff/src/lib.rs @@ -1,10 +1,10 @@ //! Algorithms for diffing various git object types and for generating patches, highly optimized for performance. //! ## Feature Flags #![cfg_attr( -feature = "document-features", -cfg_attr(doc, doc = ::document_features::document_features!()) +all(doc, feature = "document-features"), +doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms)] #![forbid(unsafe_code)] diff --git a/gix-features/Cargo.toml b/gix-features/Cargo.toml index 2a5dd674da1..9146bbdafa9 100644 --- a/gix-features/Cargo.toml +++ b/gix-features/Cargo.toml @@ -159,4 +159,3 @@ sha1 = { version = "0.10.0", optional = true, features = ["asm"] } [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-features/src/lib.rs b/gix-features/src/lib.rs index f343b264719..18342b1d92e 100644 --- a/gix-features/src/lib.rs +++ b/gix-features/src/lib.rs @@ -8,10 +8,10 @@ //! counterparts with higher performance. //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] /// diff --git a/gix-fs/Cargo.toml b/gix-fs/Cargo.toml index 29a1d0b736d..23d22cfed14 100644 --- a/gix-fs/Cargo.toml +++ b/gix-fs/Cargo.toml @@ -12,8 +12,13 @@ include = ["src/**/*", "LICENSE-*"] [lib] doctest = false +[features] +## Data structures implement `serde::Serialize` and `serde::Deserialize`. +serde = ["dep:serde"] + [dependencies] gix-features = { version = "^0.36.0", path = "../gix-features" } +serde = { version = "1.0.114", optional = true, default-features = false, features = ["std", "derive"] } [dev-dependencies] tempfile = "3.5.0" diff --git a/gix-glob/Cargo.toml b/gix-glob/Cargo.toml index bb399dd2267..9511926fcbe 100644 --- a/gix-glob/Cargo.toml +++ b/gix-glob/Cargo.toml @@ -31,4 +31,3 @@ gix-testtools = { path = "../tests/tools"} [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-glob/src/lib.rs b/gix-glob/src/lib.rs index a753e671a3e..ee8599fc8ec 100644 --- a/gix-glob/src/lib.rs +++ b/gix-glob/src/lib.rs @@ -1,10 +1,10 @@ //! Provide glob [`Patterns`][Pattern] for matching against paths or anything else. //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms)] #![forbid(unsafe_code)] diff --git a/gix-hash/Cargo.toml b/gix-hash/Cargo.toml index dceff6b2423..14c5ee32de5 100644 --- a/gix-hash/Cargo.toml +++ b/gix-hash/Cargo.toml @@ -31,4 +31,3 @@ gix-features = { path = "../gix-features", features = ["rustsha1"] } [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-hash/src/lib.rs b/gix-hash/src/lib.rs index f4a8d3f23eb..7dda8eb4c0d 100644 --- a/gix-hash/src/lib.rs +++ b/gix-hash/src/lib.rs @@ -3,10 +3,10 @@ //! These are provided in [borrowed versions][oid] as well as an [owned one][ObjectId]. //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] #[path = "oid.rs"] diff --git a/gix-ignore/Cargo.toml b/gix-ignore/Cargo.toml index a60ca86e05f..2294b3835ab 100644 --- a/gix-ignore/Cargo.toml +++ b/gix-ignore/Cargo.toml @@ -32,5 +32,4 @@ gix-fs = { path = "../gix-fs" } [package.metadata.docs.rs] all-features = true -rustdoc-args = ["--cfg", "docsrs"] features = ["document-features"] diff --git a/gix-ignore/src/lib.rs b/gix-ignore/src/lib.rs index 20ca1cc8c9c..2678eb3e671 100644 --- a/gix-ignore/src/lib.rs +++ b/gix-ignore/src/lib.rs @@ -2,10 +2,10 @@ //! //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms)] #![forbid(unsafe_code)] diff --git a/gix-index/Cargo.toml b/gix-index/Cargo.toml index cd845b326b7..960e03851fd 100644 --- a/gix-index/Cargo.toml +++ b/gix-index/Cargo.toml @@ -47,4 +47,3 @@ libc = { version = "0.2.149" } [package.metadata.docs.rs] features = ["document-features", "serde"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-index/src/lib.rs b/gix-index/src/lib.rs index e54c4aaf1fa..73ea496ffda 100644 --- a/gix-index/src/lib.rs +++ b/gix-index/src/lib.rs @@ -1,9 +1,9 @@ //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(unsafe_code, missing_docs, rust_2018_idioms)] use std::{ops::Range, path::PathBuf}; diff --git a/gix-mailmap/Cargo.toml b/gix-mailmap/Cargo.toml index b5b40c34c53..3d2fb62657a 100644 --- a/gix-mailmap/Cargo.toml +++ b/gix-mailmap/Cargo.toml @@ -31,4 +31,3 @@ gix-testtools = { path = "../tests/tools"} [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-mailmap/src/lib.rs b/gix-mailmap/src/lib.rs index e6752131407..f6d9821eeba 100644 --- a/gix-mailmap/src/lib.rs +++ b/gix-mailmap/src/lib.rs @@ -2,10 +2,10 @@ //! using an [accelerated data-structure][Snapshot]. //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms)] #![forbid(unsafe_code)] diff --git a/gix-object/Cargo.toml b/gix-object/Cargo.toml index 62ff1504cdb..ed19fb66e66 100644 --- a/gix-object/Cargo.toml +++ b/gix-object/Cargo.toml @@ -52,5 +52,4 @@ gix-testtools = { path = "../tests/tools"} [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-object/src/lib.rs b/gix-object/src/lib.rs index 84ff22ae117..661397ca36d 100644 --- a/gix-object/src/lib.rs +++ b/gix-object/src/lib.rs @@ -2,10 +2,10 @@ //! 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!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms)] #![forbid(unsafe_code)] diff --git a/gix-odb/Cargo.toml b/gix-odb/Cargo.toml index bafb78cbd93..f259af61c84 100644 --- a/gix-odb/Cargo.toml +++ b/gix-odb/Cargo.toml @@ -44,4 +44,3 @@ document-features = { version = "0.2.0", optional = true } [package.metadata.docs.rs] features = ["document-features", "serde"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-odb/src/lib.rs b/gix-odb/src/lib.rs index 45dd3f569e1..40d7c2aea90 100644 --- a/gix-odb/src/lib.rs +++ b/gix-odb/src/lib.rs @@ -9,10 +9,10 @@ //! * multiple loose objects and pack locations as gathered from `alternates` files. //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] use std::{ diff --git a/gix-pack/Cargo.toml b/gix-pack/Cargo.toml index 7e4cdd80a0a..a22ca2bccbb 100644 --- a/gix-pack/Cargo.toml +++ b/gix-pack/Cargo.toml @@ -66,4 +66,3 @@ gix-testtools = { path = "../tests/tools"} [package.metadata.docs.rs] all-features = true features = ["document-features", "pack-cache-lru-dynamic", "object-cache-dynamic", "serde"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-pack/src/lib.rs b/gix-pack/src/lib.rs index 200b8701942..b56d1fe983e 100755 --- a/gix-pack/src/lib.rs +++ b/gix-pack/src/lib.rs @@ -12,10 +12,10 @@ //! 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!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] /// diff --git a/gix-packetline-blocking/Cargo.toml b/gix-packetline-blocking/Cargo.toml index f962c62fb02..477047c909e 100644 --- a/gix-packetline-blocking/Cargo.toml +++ b/gix-packetline-blocking/Cargo.toml @@ -19,6 +19,9 @@ default = ["blocking-io"] ## If set, all IO will become blocking. The same types will be used preventing side-by-side usage of blocking and non-blocking IO. blocking-io = [] +## DO NOT USE, use instead directly gix-packetline +async-io = [] + #! ### Other ## Data structures implement `serde::Serialize` and `serde::Deserialize`. serde = ["dep:serde", "bstr/serde"] @@ -35,4 +38,3 @@ document-features = { version = "0.2.0", optional = true } [package.metadata.docs.rs] features = ["document-features", "blocking-io", "serde"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-packetline/Cargo.toml b/gix-packetline/Cargo.toml index a275160c4ee..a0b5c62facc 100644 --- a/gix-packetline/Cargo.toml +++ b/gix-packetline/Cargo.toml @@ -61,4 +61,3 @@ maybe-async = "0.2.6" [package.metadata.docs.rs] features = ["document-features", "blocking-io", "serde"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-packetline/src/lib.rs b/gix-packetline/src/lib.rs index 19ffce5fd95..95ecd59d25c 100644 --- a/gix-packetline/src/lib.rs +++ b/gix-packetline/src/lib.rs @@ -3,10 +3,10 @@ //! For reading the packet line format use the [`StreamingPeekableIter`], and for writing the [`Writer`]. //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, all(doc, feature = "document-features")), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] const U16_HEX_BYTES: usize = 4; diff --git a/gix-protocol/Cargo.toml b/gix-protocol/Cargo.toml index c976838de03..6552ddc775c 100644 --- a/gix-protocol/Cargo.toml +++ b/gix-protocol/Cargo.toml @@ -67,4 +67,3 @@ gix-testtools = { path = "../tests/tools" } [package.metadata.docs.rs] features = ["blocking-client", "document-features", "serde"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-protocol/src/lib.rs b/gix-protocol/src/lib.rs index 7f7355711a2..6b4ee69d2b6 100644 --- a/gix-protocol/src/lib.rs +++ b/gix-protocol/src/lib.rs @@ -4,10 +4,10 @@ //! the actual client implementation. //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] /// A selector for V2 commands to invoke on the server for purpose of pre-invocation validation. diff --git a/gix-ref/Cargo.toml b/gix-ref/Cargo.toml index eda5e808c82..cdef75e83cf 100644 --- a/gix-ref/Cargo.toml +++ b/gix-ref/Cargo.toml @@ -45,4 +45,3 @@ gix-testtools = { path = "../tests/tools" } [package.metadata.docs.rs] features = ["document-features", "serde"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-ref/src/lib.rs b/gix-ref/src/lib.rs index aea2da8126b..2a0b8987632 100644 --- a/gix-ref/src/lib.rs +++ b/gix-ref/src/lib.rs @@ -17,10 +17,10 @@ //! //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] use std::borrow::Cow; diff --git a/gix-revision/Cargo.toml b/gix-revision/Cargo.toml index a7ef92aa815..4b0de10dd45 100644 --- a/gix-revision/Cargo.toml +++ b/gix-revision/Cargo.toml @@ -42,4 +42,3 @@ gix-commitgraph = { path = "../gix-commitgraph" } [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-revision/src/lib.rs b/gix-revision/src/lib.rs index 8929c0204fe..1593c25c1a8 100644 --- a/gix-revision/src/lib.rs +++ b/gix-revision/src/lib.rs @@ -2,10 +2,10 @@ //! //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] /// diff --git a/gix-sec/Cargo.toml b/gix-sec/Cargo.toml index 996b7c60fb6..28ce54da8a9 100644 --- a/gix-sec/Cargo.toml +++ b/gix-sec/Cargo.toml @@ -41,4 +41,3 @@ tempfile = "3.3.0" [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-sec/src/lib.rs b/gix-sec/src/lib.rs index afba959505e..35b7b34d524 100644 --- a/gix-sec/src/lib.rs +++ b/gix-sec/src/lib.rs @@ -2,10 +2,10 @@ //! //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] // `unsafe_code` not forbidden because we need to interact with the libc #![deny(missing_docs, rust_2018_idioms, unsafe_code)] diff --git a/gix-tempfile/Cargo.toml b/gix-tempfile/Cargo.toml index baaebd686a8..4d1ef93d555 100644 --- a/gix-tempfile/Cargo.toml +++ b/gix-tempfile/Cargo.toml @@ -54,5 +54,4 @@ libc = { version = "0.2.98", default-features = false } [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-tempfile/src/lib.rs b/gix-tempfile/src/lib.rs index 9af100f3601..2369967e3f9 100644 --- a/gix-tempfile/src/lib.rs +++ b/gix-tempfile/src/lib.rs @@ -28,10 +28,10 @@ //! //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] use std::{ diff --git a/gix-trace/Cargo.toml b/gix-trace/Cargo.toml index 20a97c642a3..7d9386ece7e 100644 --- a/gix-trace/Cargo.toml +++ b/gix-trace/Cargo.toml @@ -36,4 +36,3 @@ document-features = { version = "0.2.0", optional = true } [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-trace/src/lib.rs b/gix-trace/src/lib.rs index ab9409534e7..f82f5bc4e90 100644 --- a/gix-trace/src/lib.rs +++ b/gix-trace/src/lib.rs @@ -5,10 +5,10 @@ //! Crates that use `gix-features` should use `gix_features::trace`, and those who don't can use `gix_trace` directly. //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] /// The level at which the tracing item should be created. diff --git a/gix-transport/Cargo.toml b/gix-transport/Cargo.toml index 155d6acc96c..7c5d6714313 100644 --- a/gix-transport/Cargo.toml +++ b/gix-transport/Cargo.toml @@ -95,4 +95,3 @@ blocking = "1.0.2" [package.metadata.docs.rs] features = ["http-client-curl", "document-features", "serde"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-transport/src/lib.rs b/gix-transport/src/lib.rs index 4ec2ea61557..60f2d538403 100644 --- a/gix-transport/src/lib.rs +++ b/gix-transport/src/lib.rs @@ -4,10 +4,10 @@ //! All git transports are supported, including `ssh`, `git`, `http` and `https`, as well as local repository paths. //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms)] #![forbid(unsafe_code)] diff --git a/gix-url/Cargo.toml b/gix-url/Cargo.toml index 1073bca79cd..0dd0861b023 100644 --- a/gix-url/Cargo.toml +++ b/gix-url/Cargo.toml @@ -35,4 +35,3 @@ gix-testtools = { path = "../tests/tools" } [package.metadata.docs.rs] all-features = true features = ["document-features"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-url/src/lib.rs b/gix-url/src/lib.rs index 6859a9e964e..ecd1ff0951f 100644 --- a/gix-url/src/lib.rs +++ b/gix-url/src/lib.rs @@ -1,10 +1,10 @@ //! A library implementing a URL for use in git with access to its special capabilities. //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(rust_2018_idioms, missing_docs)] #![forbid(unsafe_code)] diff --git a/gix-worktree/Cargo.toml b/gix-worktree/Cargo.toml index f7208fcd705..4c387f1ec7b 100644 --- a/gix-worktree/Cargo.toml +++ b/gix-worktree/Cargo.toml @@ -38,4 +38,3 @@ document-features = { version = "0.2.0", optional = true } [package.metadata.docs.rs] features = ["document-features", "serde"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix-worktree/src/lib.rs b/gix-worktree/src/lib.rs index b8e2e89746b..3e6fc19d503 100644 --- a/gix-worktree/src/lib.rs +++ b/gix-worktree/src/lib.rs @@ -4,10 +4,10 @@ //! //! ## Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] use bstr::BString; pub use gix_glob; diff --git a/gix/Cargo.toml b/gix/Cargo.toml index 931fccf5c3c..6c3c19715b6 100644 --- a/gix/Cargo.toml +++ b/gix/Cargo.toml @@ -301,4 +301,3 @@ async-std = { version = "1.12.0", features = ["attributes"] } [package.metadata.docs.rs] features = ["document-features", "max-performance", "blocking-network-client", "blocking-http-transport-curl", "serde"] -rustdoc-args = ["--cfg", "docsrs"] diff --git a/gix/src/lib.rs b/gix/src/lib.rs index 8218defc892..d4928b9de43 100644 --- a/gix/src/lib.rs +++ b/gix/src/lib.rs @@ -82,10 +82,10 @@ //! //! ### Feature Flags #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(missing_docs, rust_2018_idioms, unsafe_code)] #![allow(clippy::result_large_err)] diff --git a/src/lib.rs b/src/lib.rs index cc9222f41a3..977d8694e89 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,10 +16,10 @@ //! Feature configuration can be complex and this document seeks to provide an overview. //! #![cfg_attr( - feature = "document-features", - cfg_attr(doc, doc = ::document_features::document_features!()) + all(doc, feature = "document-features"), + doc = ::document_features::document_features!() )] -#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![cfg_attr(all(doc, feature = "document-features"), feature(doc_cfg, doc_auto_cfg))] #![deny(rust_2018_idioms)] #![allow(missing_docs)] #![forbid(unsafe_code)] diff --git a/src/shared.rs b/src/shared.rs index ef0068ab4e5..b3d159c853b 100644 --- a/src/shared.rs +++ b/src/shared.rs @@ -270,28 +270,6 @@ pub fn setup_line_renderer_range( ) } -#[cfg(all(feature = "lean-cli", not(feature = "pretty-cli")))] -pub fn from_env() -> T { - static VERSION: &str = concat!(env!("CARGO_PKG_NAME"), " ", env!("CARGO_PKG_VERSION")); - let strings: Vec = std::env::args().collect(); - let strs: Vec<&str> = strings.iter().map(|s| s.as_str()).collect(); - T::from_args(&[strs[0]], &strs[1..]).unwrap_or_else(|early_exit| { - // This allows us to make subcommands mandatory, - // and trigger a helpful message unless --version is specified - if let Some(arg) = std::env::args().nth(1) { - if arg == "--version" { - println!("{}", VERSION); - std::process::exit(0); - } - } - println!("{}", early_exit.output); - std::process::exit(match early_exit.status { - Ok(()) => 0, - Err(()) => 1, - }) - }) -} - mod clap { use std::{ffi::OsStr, str::FromStr};