diff --git a/Cargo.lock b/Cargo.lock index 035ed5e..ffddbfe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -186,7 +186,6 @@ dependencies = [ "convert_case", "derive_setters", "lazy_static", - "macros", "oapi", "oas3", "openapi3-parser", @@ -523,15 +522,6 @@ dependencies = [ "logos-codegen", ] -[[package]] -name = "macros" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.90", -] - [[package]] name = "memchr" version = "2.7.4" diff --git a/Cargo.toml b/Cargo.toml index 96cc657..0ffb672 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,8 +21,7 @@ wit-parser = "0.222.0" lazy_static = "1.5.0" base64 = "0.22.1" strum_macros = "0.26.4" -macros = {path = "macros"} derive_setters = "0.1.6" [workspace] -members = [".", "macros"] +members = ["."] diff --git a/macros/Cargo.lock b/macros/Cargo.lock deleted file mode 100644 index 8821391..0000000 --- a/macros/Cargo.lock +++ /dev/null @@ -1,7 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "macros" -version = "0.1.0" diff --git a/macros/Cargo.toml b/macros/Cargo.toml deleted file mode 100644 index a47dfa6..0000000 --- a/macros/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "macros" -version = "0.1.0" -edition = "2021" - -[lib] -proc-macro = true - -[dependencies] -syn = { version = "2.0.60", features = ["derive", "full"] } -quote = "1.0.36" -proc-macro2 = "1.0.81" diff --git a/macros/src/lib.rs b/macros/src/lib.rs deleted file mode 100644 index 0ced838..0000000 --- a/macros/src/lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -use proc_macro::TokenStream; - -mod merge_right; - -use crate::merge_right::expand_merge_right_derive; -#[proc_macro_derive(MergeRight, attributes(merge_right))] -pub fn merge_right_derive(input: TokenStream) -> TokenStream { - expand_merge_right_derive(input) -} diff --git a/macros/src/merge_right.rs b/macros/src/merge_right.rs deleted file mode 100644 index cecf596..0000000 --- a/macros/src/merge_right.rs +++ /dev/null @@ -1,186 +0,0 @@ -extern crate proc_macro; - -use proc_macro::TokenStream; -use quote::quote; -use syn::spanned::Spanned; -use syn::{parse_macro_input, Data, DeriveInput, Fields, Index}; - -const MERGE_RIGHT_FN: &str = "merge_right_fn"; -const MERGE_RIGHT: &str = "merge_right"; - -#[derive(Default)] -struct Attrs { - merge_right_fn: Option, -} - -fn get_attrs(attrs: &[syn::Attribute]) -> syn::Result { - let mut attrs_ret = Attrs::default(); - for attr in attrs { - if attr.path().is_ident(MERGE_RIGHT) { - attr.parse_nested_meta(|meta| { - if meta.path.is_ident(MERGE_RIGHT_FN) { - let p: syn::Expr = meta.value()?.parse()?; - let lit = - if let syn::Expr::Lit(syn::ExprLit { lit: syn::Lit::Str(lit), .. }) = p { - let suffix = lit.suffix(); - if !suffix.is_empty() { - return Err(syn::Error::new( - lit.span(), - format!("unexpected suffix `{}` on string literal", suffix), - )); - } - lit - } else { - return Err(syn::Error::new( - p.span(), - format!( - "expected merge_right {} attribute to be a string.", - MERGE_RIGHT_FN - ), - )); - }; - let expr_path: syn::ExprPath = lit.parse()?; - attrs_ret.merge_right_fn = Some(expr_path); - Ok(()) - } else { - Err(syn::Error::new(attr.span(), "Unknown helper attribute.")) - } - })?; - } - } - Ok(attrs_ret) -} - -pub fn expand_merge_right_derive(input: TokenStream) -> TokenStream { - let input = parse_macro_input!(input as DeriveInput); - - let name = input.ident.clone(); - let generics = input.generics.clone(); - let gen = match input.data { - // Implement for structs - Data::Struct(data) => { - let fields = match &data.fields { - Fields::Named(fields) => &fields.named, - Fields::Unnamed(fields) => &fields.unnamed, - Fields::Unit => { - return quote! { - impl crate::merge_right::MergeRight for #name { - fn merge_right(self, other: Self) -> Self { - other - } - } - } - .into() - } - }; - - let merge_logic = fields.iter().enumerate().map(|(i, f)| { - let attrs = get_attrs(&f.attrs); - if let Err(err) = attrs { - panic!("{}", err); - } - let attrs = attrs.unwrap(); - let name = &f.ident; - - match &data.fields { - Fields::Named(_) => { - if let Some(merge_right_fn) = attrs.merge_right_fn { - quote! { - #name: #merge_right_fn(self.#name, other.#name), - } - } else { - quote! { - #name: self.#name.merge_right(other.#name), - } - } - } - Fields::Unnamed(_) => { - let name = Index::from(i); - if let Some(merge_right_fn) = attrs.merge_right_fn { - quote! { - #merge_right_fn(self.#name, other.#name), - } - } else { - quote! { - self.#name.merge_right(other.#name), - } - } - } - Fields::Unit => unreachable!(), - } - }); - - let generics_lt = generics.lt_token; - let generics_gt = generics.gt_token; - let generics_params = generics.params; - - let generics_del = quote! { - #generics_lt #generics_params #generics_gt - }; - - let initializer = match data.fields { - Fields::Named(_) => quote! { - Self { - #(#merge_logic)* - } - }, - Fields::Unnamed(_) => quote! { - Self(#(#merge_logic)*) - }, - Fields::Unit => unreachable!(), - }; - - quote! { - impl #generics_del crate::merge_right::MergeRight for #name #generics_del { - fn merge_right(self, other: Self) -> Self { - #initializer - } - } - } - } - // Implement for enums - Data::Enum(_) => quote! { - impl crate::merge_right::MergeRight for #name { - fn merge_right(self, other: Self) -> Self { - other - } - } - }, - // Optionally handle or disallow unions - Data::Union(_) => { - return syn::Error::new_spanned(input, "Union types are not supported by MergeRight") - .to_compile_error() - .into() - } - }; - - gen.into() -} - -#[cfg(test)] -mod tests { - use syn::{parse_quote, Attribute}; - - use super::*; - - #[test] - fn test_get_attrs_invalid_type() { - let attrs: Vec = vec![parse_quote!(#[merge_right(merge_right_fn = 123)])]; - let result = get_attrs(&attrs); - assert!( - result.is_err(), - "Expected error with non-string type for `merge_right_fn`" - ); - } - - #[test] - fn test_get_attrs_unexpected_suffix() { - let attrs: Vec = - vec![parse_quote!(#[merge_right(merge_right_fn = "some_fn()")])]; - let result = get_attrs(&attrs); - assert!( - result.is_err(), - "Expected error with unexpected suffix on string literal" - ); - } -} diff --git a/src/config/config.rs b/src/config/config.rs index c04b571..64606d3 100644 --- a/src/config/config.rs +++ b/src/config/config.rs @@ -1,16 +1,15 @@ use std::collections::{BTreeMap, BTreeSet}; use serde::{Deserialize, Serialize}; -use macros::MergeRight; use crate::config::wit_types::WitType; -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, MergeRight)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct Config { pub package: String, pub interfaces: BTreeSet, pub world: World, } -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, MergeRight)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct World { pub name: String, pub uses: Vec, @@ -18,7 +17,7 @@ pub struct World { pub exports: Vec, } -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, MergeRight, derive_setters::Setters)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, derive_setters::Setters)] pub struct Interface { pub name: String, pub varients: BTreeMap, @@ -39,7 +38,7 @@ impl Ord for Interface { } } -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, MergeRight)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct Record { pub name: String, pub fields: BTreeSet, @@ -58,32 +57,32 @@ impl Ord for Record { } } -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, MergeRight)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct UseStatement { pub name: String, pub items: Vec, } -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, MergeRight)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct Function { pub name: String, pub parameters: Vec, pub return_type: ReturnTy, } -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, MergeRight)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct ReturnTy { pub return_type: String, pub error_type: Option, } -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, MergeRight)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct Parameter { pub name: String, pub parameter_type: String, } -#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, MergeRight)] +#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] pub struct Field { pub name: String, pub field_type: WitType, diff --git a/src/main.rs b/src/main.rs index b700ecc..2d90f2d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,11 +7,8 @@ use crate::value::value; mod value; mod openapi; mod config; -mod transformer; mod transform; mod tryfold; -mod merge_right; -mod primitive; mod proto; #[derive(Debug, Clone)] diff --git a/src/merge_right.rs b/src/merge_right.rs deleted file mode 100644 index b5b0883..0000000 --- a/src/merge_right.rs +++ /dev/null @@ -1,292 +0,0 @@ -use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; - -use crate::config::wit_types::WitType; - -pub trait MergeRight { - fn merge_right(self, other: Self) -> Self; -} - -impl MergeRight for Option { - fn merge_right(self, other: Self) -> Self { - match (self, other) { - (Some(this), Some(that)) => Some(this.merge_right(that)), - (None, Some(that)) => Some(that), - (Some(this), None) => Some(this), - (None, None) => None, - } - } -} - -impl MergeRight for Vec { - fn merge_right(mut self, other: Self) -> Self { - self.extend(other); - self - } -} - -impl MergeRight for BTreeSet - where - V: Ord + MergeRight, -{ - fn merge_right(self, mut other: Self) -> Self { - other.extend(self); - other - } -} - -impl MergeRight for HashSet - where - V: Eq + std::hash::Hash, -{ - fn merge_right(mut self, other: Self) -> Self { - self.extend(other); - self - } -} - -impl MergeRight for BTreeMap - where - K: Ord, - V: MergeRight, -{ - fn merge_right(mut self, other: Self) -> Self { - for (other_name, mut other_value) in other { - if let Some(self_value) = self.remove(&other_name) { - other_value = self_value.merge_right(other_value); - } - - self.insert(other_name, other_value); - } - self - } -} - -impl MergeRight for HashMap - where - K: Eq + std::hash::Hash, - V: MergeRight, -{ - fn merge_right(mut self, other: Self) -> Self { - for (other_name, mut other_value) in other { - if let Some(self_value) = self.remove(&other_name) { - other_value = self_value.merge_right(other_value); - } - - self.insert(other_name, other_value); - } - self - } -} - -impl MergeRight for WitType { - fn merge_right(self, other: Self) -> Self { - other - } -} - -#[cfg(test)] -mod tests { - use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; - - use super::MergeRight; - - #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] - struct Test(u32); - - impl From for Test { - fn from(value: u32) -> Self { - Self(value) - } - } - - impl MergeRight for Test { - fn merge_right(self, other: Self) -> Self { - Self(self.0 + other.0) - } - } - - #[test] - fn test_option() { - let x: Option = None.merge_right(None); - assert_eq!(x, None); - - let x = Some(Test::from(1)).merge_right(None); - assert_eq!(x, Some(Test::from(1))); - - let x = None.merge_right(Some(Test::from(2))); - assert_eq!(x, Some(Test::from(2))); - - let x = Some(Test::from(1)).merge_right(Some(Test::from(2))); - assert_eq!(x, Some(Test::from(3))); - } - - #[test] - fn test_vec() { - let l: Vec = vec![]; - let r: Vec = vec![]; - assert_eq!(l.merge_right(r), vec![]); - - let l: Vec = vec![Test::from(1), Test::from(2)]; - let r: Vec = vec![]; - assert_eq!(l.merge_right(r), vec![Test::from(1), Test::from(2)]); - - let l: Vec = vec![]; - let r: Vec = vec![Test::from(3), Test::from(4)]; - assert_eq!(l.merge_right(r), vec![Test::from(3), Test::from(4)]); - - let l: Vec = vec![Test::from(1), Test::from(2)]; - let r: Vec = vec![Test::from(3), Test::from(4)]; - assert_eq!( - l.merge_right(r), - vec![Test::from(1), Test::from(2), Test::from(3), Test::from(4)] - ); - } - - #[test] - fn test_btree_set() { - let l: BTreeSet = BTreeSet::from_iter(vec![]); - let r: BTreeSet = BTreeSet::from_iter(vec![]); - assert_eq!(l.merge_right(r), BTreeSet::from_iter(vec![])); - - let l: BTreeSet = BTreeSet::from_iter(vec![Test::from(1), Test::from(2)]); - let r: BTreeSet = BTreeSet::from_iter(vec![]); - assert_eq!( - l.merge_right(r), - BTreeSet::from_iter(vec![Test::from(1), Test::from(2)]) - ); - - let l: BTreeSet = BTreeSet::from_iter(vec![]); - let r: BTreeSet = BTreeSet::from_iter(vec![Test::from(3), Test::from(4)]); - assert_eq!( - l.merge_right(r), - BTreeSet::from_iter(vec![Test::from(3), Test::from(4)]) - ); - - let l: BTreeSet = BTreeSet::from_iter(vec![Test::from(1), Test::from(2)]); - let r: BTreeSet = - BTreeSet::from_iter(vec![Test::from(2), Test::from(3), Test::from(4)]); - assert_eq!( - l.merge_right(r), - BTreeSet::from_iter(vec![ - Test::from(1), - Test::from(2), - Test::from(3), - Test::from(4) - ]) - ); - } - - #[test] - fn test_hash_set() { - let l: HashSet = HashSet::from_iter(vec![]); - let r: HashSet = HashSet::from_iter(vec![]); - assert_eq!(l.merge_right(r), HashSet::from_iter(vec![])); - - let l: HashSet = HashSet::from_iter(vec![Test::from(1), Test::from(2)]); - let r: HashSet = HashSet::from_iter(vec![]); - assert_eq!( - l.merge_right(r), - HashSet::from_iter(vec![Test::from(1), Test::from(2)]) - ); - - let l: HashSet = HashSet::from_iter(vec![]); - let r: HashSet = HashSet::from_iter(vec![Test::from(3), Test::from(4)]); - assert_eq!( - l.merge_right(r), - HashSet::from_iter(vec![Test::from(3), Test::from(4)]) - ); - - let l: HashSet = HashSet::from_iter(vec![Test::from(1), Test::from(2)]); - let r: HashSet = - HashSet::from_iter(vec![Test::from(2), Test::from(3), Test::from(4)]); - assert_eq!( - l.merge_right(r), - HashSet::from_iter(vec![ - Test::from(1), - Test::from(2), - Test::from(3), - Test::from(4) - ]) - ); - } - - #[test] - fn test_btree_map() { - let l: BTreeMap = BTreeMap::from_iter(vec![]); - let r: BTreeMap = BTreeMap::from_iter(vec![]); - assert_eq!(l.merge_right(r), BTreeMap::from_iter(vec![])); - - let l: BTreeMap = - BTreeMap::from_iter(vec![(1, Test::from(1)), (2, Test::from(2))]); - let r: BTreeMap = BTreeMap::from_iter(vec![]); - assert_eq!( - l.merge_right(r), - BTreeMap::from_iter(vec![(1, Test::from(1)), (2, Test::from(2))]) - ); - - let l: BTreeMap = BTreeMap::from_iter(vec![]); - let r: BTreeMap = - BTreeMap::from_iter(vec![(3, Test::from(3)), (4, Test::from(4))]); - assert_eq!( - l.merge_right(r), - BTreeMap::from_iter(vec![(3, Test::from(3)), (4, Test::from(4))]) - ); - - let l: BTreeMap = - BTreeMap::from_iter(vec![(1, Test::from(1)), (2, Test::from(2))]); - let r: BTreeMap = BTreeMap::from_iter(vec![ - (2, Test::from(5)), - (3, Test::from(3)), - (4, Test::from(4)), - ]); - assert_eq!( - l.merge_right(r), - BTreeMap::from_iter(vec![ - (1, Test::from(1)), - (2, Test::from(7)), - (3, Test::from(3)), - (4, Test::from(4)) - ]) - ); - } - - #[test] - fn test_hash_map() { - let l: HashMap = HashMap::from_iter(vec![]); - let r: HashMap = HashMap::from_iter(vec![]); - assert_eq!(l.merge_right(r), HashMap::from_iter(vec![])); - - let l: HashMap = - HashMap::from_iter(vec![(1, Test::from(1)), (2, Test::from(2))]); - let r: HashMap = HashMap::from_iter(vec![]); - assert_eq!( - l.merge_right(r), - HashMap::from_iter(vec![(1, Test::from(1)), (2, Test::from(2))]) - ); - - let l: HashMap = HashMap::from_iter(vec![]); - let r: HashMap = - HashMap::from_iter(vec![(3, Test::from(3)), (4, Test::from(4))]); - assert_eq!( - l.merge_right(r), - HashMap::from_iter(vec![(3, Test::from(3)), (4, Test::from(4))]) - ); - - let l: HashMap = - HashMap::from_iter(vec![(1, Test::from(1)), (2, Test::from(2))]); - let r: HashMap = HashMap::from_iter(vec![ - (2, Test::from(5)), - (3, Test::from(3)), - (4, Test::from(4)), - ]); - assert_eq!( - l.merge_right(r), - HashMap::from_iter(vec![ - (1, Test::from(1)), - (2, Test::from(7)), - (3, Test::from(3)), - (4, Test::from(4)) - ]) - ); - } -} diff --git a/src/primitive.rs b/src/primitive.rs deleted file mode 100644 index 8c50cb0..0000000 --- a/src/primitive.rs +++ /dev/null @@ -1,29 +0,0 @@ -use std::marker::PhantomData; -use std::num::NonZeroU64; - -use crate::merge_right::MergeRight; - -pub trait Primitive {} - -impl Primitive for bool {} -impl Primitive for char {} -impl Primitive for f32 {} -impl Primitive for f64 {} -impl Primitive for i16 {} -impl Primitive for i32 {} -impl Primitive for i64 {} -impl Primitive for i8 {} -impl Primitive for NonZeroU64 {} -impl Primitive for String {} -impl Primitive for u16 {} -impl Primitive for u32 {} -impl Primitive for u64 {} -impl Primitive for u8 {} -impl Primitive for usize {} -impl Primitive for PhantomData {} - -impl MergeRight for A { - fn merge_right(self, other: Self) -> Self { - other - } -} diff --git a/src/proto/handle_types.rs b/src/proto/handle_types.rs index c8df1f6..a901688 100644 --- a/src/proto/handle_types.rs +++ b/src/proto/handle_types.rs @@ -1,19 +1,18 @@ use std::collections::{BTreeMap, BTreeSet}; -use anyhow::anyhow; -use convert_case::Case; -use protox::prost_reflect::prost_types::{DescriptorProto, EnumDescriptorProto, FileDescriptorProto, FileDescriptorSet}; +use convert_case::Case; +use convert_case::Casing; +use protox::prost_reflect::prost_types::{DescriptorProto, EnumDescriptorProto, FileDescriptorSet}; use tailcall_valid::{Valid, Validator}; use crate::config::config::{Config, Field, Interface, Record}; use crate::config::wit_types::WitType; -use convert_case::Casing; use crate::proto::proto::process_ty; fn append_enums(file: &[EnumDescriptorProto]) -> Valid, anyhow::Error, anyhow::Error> { - Valid::from_iter(file.iter().enumerate(), |(i, enum_)| { + Valid::from_iter(file.iter(), |enum_| { let enum_name = enum_.name().to_case(Case::Kebab); - Valid::from_iter(enum_.value.iter().enumerate(), |(j, value)| { + Valid::from_iter(enum_.value.iter(), |value| { Valid::succeed(value.name().to_case(Case::Kebab)) }).and_then(|varients| { Valid::succeed((enum_name, WitType::Enum(varients))) @@ -24,7 +23,7 @@ fn append_enums(file: &[EnumDescriptorProto]) -> Valid fn append_message(messages: &[DescriptorProto]) -> Valid, anyhow::Error, anyhow::Error> { Valid::from_iter(messages.iter(), |message| { let record_name = message.name().to_case(Case::Kebab); - Valid::from_iter(message.field.iter().enumerate(), |(i, field)| { + Valid::from_iter(message.field.iter(), |field| { if let Some(ty_) = field.type_name.as_ref() { process_ty(ty_).map(|ty| (field.name().to_case(Case::Kebab), ty)) } else { @@ -47,35 +46,33 @@ fn append_message(messages: &[DescriptorProto]) -> Valid, anyhow::Er } pub fn handle_types(config: Config, proto: &[FileDescriptorSet], package: String) -> Valid { - Valid::succeed(config) - .and_then(|config| { - Valid::from_iter(proto.iter(), |set| { - let mut map = BTreeMap::new(); - let mut records = BTreeSet::new(); - Valid::from_iter(set.file.iter(), |file| { - append_enums(&file.enum_type).and_then(|varients| { - append_message(&file.message_type) - .and_then(|recs| { - map.extend(varients); - records.extend(BTreeSet::from_iter(recs.into_iter())); - Valid::succeed(()) - }) - }) - }) - .and_then(|_| { - Valid::succeed(Interface { - name: "type".to_string(), - varients: map, - records, - ..Default::default() - }) + Valid::from_iter(proto.iter(), |set| { + let mut map = BTreeMap::new(); + let mut records = BTreeSet::new(); + Valid::from_iter(set.file.iter(), |file| { + append_enums(&file.enum_type).and_then(|varients| { + append_message(&file.message_type) + .and_then(|recs| { + map.extend(varients); + records.extend(BTreeSet::from_iter(recs.into_iter())); + Valid::succeed(()) }) }) - }).and_then(|v| { + }) + .and_then(|_| { + Valid::succeed(Interface { + name: "type".to_string(), + varients: map, + records, + ..Default::default() + }) + }) + }).and_then(|mut interfaces| { + interfaces.extend(config.interfaces.into_iter()); Valid::succeed(Config { package, - interfaces: v.into_iter().collect(), - world: Default::default(), + interfaces: interfaces.into_iter().collect(), + ..config }) }) } diff --git a/src/proto/proto.rs b/src/proto/proto.rs index 6b8823c..ce3344a 100644 --- a/src/proto/proto.rs +++ b/src/proto/proto.rs @@ -53,8 +53,7 @@ mod t { #[test] fn bar() { let relative = format!("{}/src/proto/fixtures",env!("CARGO_MANIFEST_DIR")); - let x = std::fs::read_to_string(format!("{}/address.proto", relative)).unwrap(); - let proto = protox::compile([format!("{}/address.proto", relative)], [relative]).unwrap(); + let proto = protox::compile([format!("{}/address.proto", relative)], [relative]).unwrap(); let proto = Proto::new([proto]); let config = proto.to_config().to_result().unwrap(); println!("{}", config.to_wit()); diff --git a/src/transformer.rs b/src/transformer.rs deleted file mode 100644 index e243721..0000000 --- a/src/transformer.rs +++ /dev/null @@ -1,7 +0,0 @@ -use tailcall_valid::Valid; - -pub trait Transform { - type Value; - type Error; - fn transform(&self, value: Self::Value) -> Valid; -} \ No newline at end of file