-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add '#[ts(bound)]' attribute #269
Add '#[ts(bound)]' attribute #269
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WilsonGramer Looks good! Could you add docs for it (type doc of TS
)?
macros/src/lib.rs
Outdated
let where_bound = bounds.map_or_else( | ||
|| { | ||
let bounds = generate_where_clause(generics, dependencies); | ||
quote! { #bounds } | ||
}, | ||
|bounds| { | ||
let bounds = syn::parse_str::<TokenStream>(bounds).expect("malformed `bounds`"); | ||
quote! { where #bounds } | ||
}, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer a match
here. No problem if you prefer map_or_else, though.
Hey @WilsonGramer! I have made some changes to improve error locations and opened a PR to your fork (this PR has maintainer edits disabled), please check it out WilsonGramer#1 |
Parse string into WherePredicate to improve errors
@NyxCode I added the docs and merged in @escritorio-gustavo's changes — let me know if anything else needs to be done! |
I'm happy with this, thanks! |
No description provided.