From 915127d7490626e19dac567bcaa52b84550b00fb Mon Sep 17 00:00:00 2001 From: Maccesch Date: Fri, 23 Jun 2023 22:13:14 +0100 Subject: [PATCH] re-added doc cfg feature flag but commented out --- Cargo.toml | 2 +- src/lib.rs | 2 +- src/math/mod.rs | 1 + src/math/use_abs.rs | 1 + src/math/use_ceil.rs | 1 + src/math/use_floor.rs | 1 + src/math/use_max.rs | 1 + src/math/use_min.rs | 1 + src/math/use_round.rs | 1 + src/storage/shared.rs | 1 + src/storage/use_local_storage.rs | 1 + src/storage/use_session_storage.rs | 1 + src/storage/use_storage.rs | 4 ++++ 13 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3b8bdd1..911076f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ repository = "https://github.com/Synphonyte/leptos-use" homepage = "https://leptos-use.rs" [dependencies] -leptos = "0.3" +leptos = { version = "0.3", default-features = false } wasm-bindgen = "0.2" js-sys = "0.3" default-struct-builder = "0.2" diff --git a/src/lib.rs b/src/lib.rs index 0c7a065..99cf7d3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -//#![feature(doc_cfg)] +// #![feature(doc_cfg)] //! Collection of essential Leptos utilities inspired by SolidJS USE / VueUse pub mod core; diff --git a/src/math/mod.rs b/src/math/mod.rs index bcaa57b..5734864 100644 --- a/src/math/mod.rs +++ b/src/math/mod.rs @@ -1,3 +1,4 @@ +// #![doc(cfg(feature = "math"))] //! Collection of reactive math functions mod shared; diff --git a/src/math/use_abs.rs b/src/math/use_abs.rs index 71696ad..6d8ce57 100644 --- a/src/math/use_abs.rs +++ b/src/math/use_abs.rs @@ -25,5 +25,6 @@ use_simple_math!( /// # view! { cx, } /// # } /// ``` + // #[doc(cfg(feature = "math"))] abs ); diff --git a/src/math/use_ceil.rs b/src/math/use_ceil.rs index 2129f5e..270841f 100644 --- a/src/math/use_ceil.rs +++ b/src/math/use_ceil.rs @@ -25,5 +25,6 @@ use_simple_math!( /// # view! { cx, } /// # } /// ``` + // #[doc(cfg(feature = "math"))] ceil ); diff --git a/src/math/use_floor.rs b/src/math/use_floor.rs index 670fce7..1b1409c 100644 --- a/src/math/use_floor.rs +++ b/src/math/use_floor.rs @@ -25,5 +25,6 @@ use_simple_math!( /// # view! { cx, } /// # } /// ``` + // #[doc(cfg(feature = "math"))] floor ); diff --git a/src/math/use_max.rs b/src/math/use_max.rs index 725cb97..56dafac 100644 --- a/src/math/use_max.rs +++ b/src/math/use_max.rs @@ -26,6 +26,7 @@ use_partial_cmp!( /// # view! { cx, } /// # } /// ``` + // #[doc(cfg(feature = "math"))] use_max, Ordering::Less ); diff --git a/src/math/use_min.rs b/src/math/use_min.rs index 8d26e29..dc8b353 100644 --- a/src/math/use_min.rs +++ b/src/math/use_min.rs @@ -26,6 +26,7 @@ use_partial_cmp!( /// # view! { cx, } /// # } /// ``` + // #[doc(cfg(feature = "math"))] use_min, Ordering::Greater ); diff --git a/src/math/use_round.rs b/src/math/use_round.rs index e18a22c..114e505 100644 --- a/src/math/use_round.rs +++ b/src/math/use_round.rs @@ -25,5 +25,6 @@ use_simple_math!( /// # view! { cx, } /// # } /// ``` + // #[doc(cfg(feature = "math"))] round ); diff --git a/src/storage/shared.rs b/src/storage/shared.rs index 06706f4..434334c 100644 --- a/src/storage/shared.rs +++ b/src/storage/shared.rs @@ -49,6 +49,7 @@ macro_rules! use_specific_storage { pub(crate) use use_specific_storage; /// Options for [`use_local_storage_with_options`]. +// #[doc(cfg(feature = "storage"))] #[derive(DefaultBuilder)] pub struct UseSpecificStorageOptions { /// Listen to changes to this storage key from somewhere else. Defaults to true. diff --git a/src/storage/use_local_storage.rs b/src/storage/use_local_storage.rs index c0003a6..80c7822 100644 --- a/src/storage/use_local_storage.rs +++ b/src/storage/use_local_storage.rs @@ -15,6 +15,7 @@ use_specific_storage!( /// /// * [`use_storage`] /// * [`use_session_storage`] + // #[doc(cfg(feature = "storage"))] local /// [`use_local_storage`] ); diff --git a/src/storage/use_session_storage.rs b/src/storage/use_session_storage.rs index bd2bdd2..dd8cfa8 100644 --- a/src/storage/use_session_storage.rs +++ b/src/storage/use_session_storage.rs @@ -15,6 +15,7 @@ use_specific_storage!( /// /// * [`use_storage`] /// * [`use_local_storage`] + // #[doc(cfg(feature = "storage"))] session /// [`use_session_storage`] ); diff --git a/src/storage/use_storage.rs b/src/storage/use_storage.rs index 6055874..73bbe30 100644 --- a/src/storage/use_storage.rs +++ b/src/storage/use_storage.rs @@ -146,6 +146,7 @@ const CUSTOM_STORAGE_EVENT_NAME: &str = "leptos-use-storage"; /// /// * [`use_local_storage`] /// * [`use_session_storage`] +// #[doc(cfg(feature = "storage"))] pub fn use_storage( cx: Scope, key: &str, @@ -160,6 +161,7 @@ where } /// Version of [`use_storage`] that accepts [`UseStorageOptions`]. See [`use_storage`] for how to use. +// #[doc(cfg(feature = "storage"))] pub fn use_storage_with_options( cx: Scope, key: &str, @@ -427,6 +429,7 @@ fn get_optional_string(v: &JsValue, key: &str) -> Option { } /// Error type for use_storage_with_options +// #[doc(cfg(feature = "storage"))] pub enum UseStorageError { NoStorage(JsValue), StorageAccessError(JsValue), @@ -436,6 +439,7 @@ pub enum UseStorageError { } /// Options for [`use_storage_with_options`]. +// #[doc(cfg(feature = "storage"))] #[derive(DefaultBuilder)] pub struct UseStorageOptions { /// Type of storage. Can be `Local` (default), `Session` or `Custom(web_sys::Storage)`