fix: circular dependencies

This commit is contained in:
zach
2024-02-22 14:04:01 -08:00
parent ddc339334e
commit f4013c5ac0
4 changed files with 5 additions and 59 deletions

View File

@@ -21,8 +21,6 @@ serde_json = "1.0.105"
extism-convert-macros.workspace = true
[dev-dependencies]
# Only required for tests run from the workspace root, as that enables the `extism-path` feature.
extism.workspace = true
serde = { version = "1.0.186", features = ["derive"] }
[features]

View File

@@ -8,18 +8,7 @@ use base64::Engine;
/// For example, the following line creates a new JSON encoding using serde_json:
///
/// ```
#[cfg_attr(
feature = "extism-path",
doc = "extism::convert::encoding!(MyJson, serde_json::to_vec, serde_json::from_slice);"
)]
#[cfg_attr(
all(feature = "extism-pdk-path", not(feature = "extism-path")),
doc = "extism_pdk::encoding!(MyJson, serde_json::to_vec, serde_json::from_slice);"
)]
#[cfg_attr(
not(any(feature = "extism-path", feature = "extism-pdk-path")),
doc = "extism_convert::encoding!(MyJson, serde_json::to_vec, serde_json::from_slice);"
)]
/// extism_convert::encoding!(MyJson, serde_json::to_vec, serde_json::from_slice);
/// ```
///
/// This will create a struct `struct MyJson<T>(pub T)` and implement [`ToBytes`] using [`serde_json::to_vec`]

View File

@@ -9,18 +9,7 @@ pub use extism_convert_macros::FromBytes;
/// `FromBytes`, e.g., [`Json`], [`Msgpack`].
///
/// ```
#[cfg_attr(
feature = "extism-path",
doc = "use extism::convert::{Json, FromBytes};"
)]
#[cfg_attr(
all(feature = "extism-pdk-path", not(feature = "extism-path")),
doc = "use extism_pdk::{Json, FromBytes};"
)]
#[cfg_attr(
not(any(feature = "extism-path", feature = "extism-pdk-path")),
doc = "use extism_convert::{Json, FromBytes};"
)]
/// use extism_convert::{Json, FromBytes};
/// use serde::Deserialize;
///
/// #[derive(FromBytes, Deserialize, PartialEq, Debug)]
@@ -39,18 +28,7 @@ pub use extism_convert_macros::FromBytes;
/// ```
/// use std::str::{self, FromStr};
/// use std::convert::Infallible;
#[cfg_attr(
feature = "extism-path",
doc = "use extism::convert::{Error, FromBytes, FromBytesOwned};"
)]
#[cfg_attr(
all(feature = "extism-pdk-path", not(feature = "extism-path")),
doc = "use extism_pdk::{Error, FromBytes, FromBytesOwned};"
)]
#[cfg_attr(
not(any(feature = "extism-path", feature = "extism-pdk-path")),
doc = "use extism_convert::{Error, FromBytes, FromBytesOwned};"
)]
/// use extism_convert::{Error, FromBytes, FromBytesOwned};
///
/// // Custom serialization using `FromStr`
/// struct StringEnc<T>(T);

View File

@@ -9,15 +9,7 @@ pub use extism_convert_macros::ToBytes;
/// `ToBytes`, e.g., [`Json`], [`Msgpack`].
///
/// ```
#[cfg_attr(feature = "extism-path", doc = "use extism::convert::{Json, ToBytes};")]
#[cfg_attr(
all(feature = "extism-pdk-path", not(feature = "extism-path")),
doc = "use extism_pdk::{Json, ToBytes};"
)]
#[cfg_attr(
not(any(feature = "extism-path", feature = "extism-pdk-path")),
doc = "use extism_convert::{Json, ToBytes};"
)]
/// use extism_convert::{Json, ToBytes};
/// use serde::Serialize;
///
/// #[derive(ToBytes, Serialize)]
@@ -34,18 +26,7 @@ pub use extism_convert_macros::ToBytes;
/// generic argument, i.e., `Type<T>(T)`, that implement `ToBytes` for the struct.
///
/// ```
#[cfg_attr(
feature = "extism-path",
doc = "use extism::convert::{Error, ToBytes};"
)]
#[cfg_attr(
all(feature = "extism-pdk-path", not(feature = "extism-path")),
doc = "use extism_pdk::{Error, ToBytes};"
)]
#[cfg_attr(
not(any(feature = "extism-path", feature = "extism-pdk-path")),
doc = "use extism_convert::{Error, ToBytes};"
)]
/// use extism_convert::{Error, ToBytes};
///
/// // Custom serialization using `ToString`
/// struct StringEnc<T>(T);