Skip to content

Commit 280fbb9

Browse files
fix: generate a top level error type alias to Infallible (#50)
1 parent 1198976 commit 280fbb9

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/fortifier-macros/src/validate.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,14 @@ impl<'a> ToTokens for Validate<'a> {
116116
{
117117
(r#type, definition)
118118
} else {
119-
(quote!(::std::convert::Infallible), None)
119+
let error_ident = format_error_ident(self.ident);
120+
121+
(
122+
error_ident.to_token_stream(),
123+
Some(quote! {
124+
type #error_ident = ::std::convert::Infallible;
125+
}),
126+
)
120127
};
121128

122129
let sync_validations = self.validations(Execution::Sync);

0 commit comments

Comments
 (0)