From 21ff50becdce195b9e033fff89ad72934e040247 Mon Sep 17 00:00:00 2001 From: Oscar Beaumont Date: Thu, 5 Oct 2023 12:32:47 +0800 Subject: [PATCH] Fix bug when compiling without `js_doc` feature --- src/lang/mod.rs | 4 +++- src/lang/ts/comments.rs | 2 +- src/lang/{ => ts}/js_doc.rs | 2 -- src/lang/ts/mod.rs | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) rename src/lang/{ => ts}/js_doc.rs (99%) diff --git a/src/lang/mod.rs b/src/lang/mod.rs index 70c9618..388d472 100644 --- a/src/lang/mod.rs +++ b/src/lang/mod.rs @@ -16,7 +16,9 @@ compile_error!("`js_doc` feature requires `typescript` feature to be enabled"); /// Also requires `typescript` feature to be enabled. #[cfg(all(feature = "js_doc", feature = "typescript"))] #[cfg_attr(docsrs, doc(cfg(all(feature = "js_doc", feature = "typescript"))))] -pub mod js_doc; +pub mod js_doc { + pub use super::ts::js_doc::*; +} // /// [Rust](https://www.rust-lang.org) language exporter. // #[cfg(feature = "rust")] diff --git a/src/lang/ts/comments.rs b/src/lang/ts/comments.rs index 7d1274f..46fe219 100644 --- a/src/lang/ts/comments.rs +++ b/src/lang/ts/comments.rs @@ -1,4 +1,4 @@ -use crate::js_doc; +use super::js_doc; use super::{CommentFormatterArgs, CommentFormatterFn}; diff --git a/src/lang/js_doc.rs b/src/lang/ts/js_doc.rs similarity index 99% rename from src/lang/js_doc.rs rename to src/lang/ts/js_doc.rs index 998c232..2e59396 100644 --- a/src/lang/js_doc.rs +++ b/src/lang/ts/js_doc.rs @@ -1,7 +1,5 @@ use std::borrow::Borrow; -use crate::*; - pub use super::ts::*; pub fn typedef_named_datatype( diff --git a/src/lang/ts/mod.rs b/src/lang/ts/mod.rs index 3c2e039..46fa93e 100644 --- a/src/lang/ts/mod.rs +++ b/src/lang/ts/mod.rs @@ -5,6 +5,7 @@ mod context; mod error; mod export_config; mod formatter; +pub(crate) mod js_doc; mod reserved_terms; pub use context::*;