From 2c1ccfa39b93ecb47cd7b5d95c38e7afdd22f21a Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Tue, 10 Sep 2024 20:51:47 +0300 Subject: [PATCH] docs(rust): properly document optional feature --- .gitattributes | 1 + Cargo.toml | 3 +++ bindings/rust/lib.rs | 2 -- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index a4336e5..fdd313b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13,4 +13,5 @@ setup.py linguist-generated Package.swift linguist-generated bindings/rust/lib.rs -linguist-generated +bindings/rust/parser.rs -linguist-generated bindings/rust/benchmark.rs -linguist-generated diff --git a/Cargo.toml b/Cargo.toml index a97f517..78a329e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,3 +47,6 @@ required-features = ["parser"] [profile.release] debug = true + +[package.metadata.docs.rs] +features = ["parser"] diff --git a/bindings/rust/lib.rs b/bindings/rust/lib.rs index cf226d4..206ead4 100644 --- a/bindings/rust/lib.rs +++ b/bindings/rust/lib.rs @@ -54,11 +54,9 @@ pub const NODE_TYPES_INLINE: &str = include_str!("../../tree-sitter-markdown-inline/src/node-types.json"); #[cfg(feature = "parser")] -#[cfg_attr(docsrs, doc(cfg(feature = "parser")))] mod parser; #[cfg(feature = "parser")] -#[cfg_attr(docsrs, doc(cfg(feature = "parser")))] pub use parser::*; #[cfg(test)]