diff --git a/core/tauri-build/src/lib.rs b/core/tauri-build/src/lib.rs index ae76f36d4..4d91e04cc 100644 --- a/core/tauri-build/src/lib.rs +++ b/core/tauri-build/src/lib.rs @@ -12,6 +12,7 @@ use std::path::{Path, PathBuf}; mod codegen; #[cfg(feature = "codegen")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "codegen")))] pub use codegen::context::CodegenContext; /// Attributes used on Windows. diff --git a/core/tauri/src/api/error.rs b/core/tauri/src/api/error.rs index e345d5fcd..62800cbef 100644 --- a/core/tauri/src/api/error.rs +++ b/core/tauri/src/api/error.rs @@ -30,6 +30,7 @@ pub enum Error { Network(#[from] attohttpc::Error), /// The network error. #[cfg(feature = "reqwest-client")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "reqwest-client")))] #[error("Network Error: {0}")] Network(#[from] reqwest::Error), /// HTTP method error. @@ -37,6 +38,7 @@ pub enum Error { HttpMethod(#[from] http::method::InvalidMethod), /// Invalid HTTP header value. #[cfg(feature = "reqwest-client")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "reqwest-client")))] #[error("{0}")] HttpHeaderValue(#[from] http::header::InvalidHeaderValue), /// Invalid HTTP header value. @@ -75,6 +77,7 @@ pub enum Error { FailedToDetectPlatform(String), /// CLI argument parsing error. #[cfg(feature = "cli")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "cli")))] #[error("failed to parse CLI arguments: {0}")] ParseCliArguments(#[from] clap::Error), /// Shell error. diff --git a/core/tauri/src/api/mod.rs b/core/tauri/src/api/mod.rs index 192d5c644..169e40cf1 100644 --- a/core/tauri/src/api/mod.rs +++ b/core/tauri/src/api/mod.rs @@ -31,9 +31,11 @@ pub use tauri_utils::config; /// The CLI args interface. #[cfg(feature = "cli")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "cli")))] pub mod cli; #[cfg(feature = "cli")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "cli")))] pub use clap; /// The desktop notifications API module. diff --git a/core/tauri/src/app.rs b/core/tauri/src/app.rs index 3495a948c..b8f17121e 100644 --- a/core/tauri/src/app.rs +++ b/core/tauri/src/app.rs @@ -1016,6 +1016,7 @@ fn on_event_loop_event(event: &RunEvent, manager: &WindowManager) /// Make `Wry` the default `Runtime` for `Builder` #[cfg(feature = "wry")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "wry")))] impl Default for Builder { fn default() -> Self { Self::new() diff --git a/core/tauri/src/error.rs b/core/tauri/src/error.rs index 334d67029..5a754521e 100644 --- a/core/tauri/src/error.rs +++ b/core/tauri/src/error.rs @@ -65,6 +65,7 @@ pub enum Error { Setup(Box), /// Tauri updater error. #[cfg(feature = "updater")] + #[cfg_attr(doc_cfg, doc(cfg(feature = "updater")))] #[error("Updater: {0}")] TauriUpdater(#[from] crate::updater::Error), /// Error initializing plugin. diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index 3a0b70f7c..68e2e59b1 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -47,9 +47,11 @@ use tauri_runtime as runtime; pub mod settings; mod state; #[cfg(feature = "updater")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "updater")))] pub mod updater; #[cfg(feature = "wry")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "wry")))] pub use tauri_runtime_wry::Wry; /// `Result`