-
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
Hackily support non-'static lifetimes #117
Conversation
Thanks for your contribution, I really appreciate it. I will take a closer look in the coming days. |
I have four other changes on my branch:
|
@NyxCode Just wanted to +1 this, if you have bandwidth! |
@thomasmost In case you're trying to use this right now, you can also include in your Cargo.toml via:
This should give you all of the above mentioned features (non-static lifetimes, slices becoming arrays, |
@NyxCode Bump on this? I think the full set of additions in my |
I believe #128 (and possibly other PRs) have fixed this, as the example provided no longer requires Slices now work as the PRs #183 and #199 were directed at fixing them
I haven't checked the Edit: |
|
This is a hacky attempt to make ts-rs support non-
'static
lifetimes by simply dropping the quantification over lifetimes in ourimpl
s ofTS
, and remapping every lifetime referenced inside of theimpl
to be'static
. This PR seems to pass the tests, but I'll admit that I just hacked this together in a couple hours without carefully looking over ts-rs, so I have no idea if it breaks everything. Almost certainly this deserves more careful scrutiny by somebody who didn't just come to ts-rs's source for the first time today.Here is an example struct that didn't work before, but works now:
(This correctly exports to
export interface Foo<> { field: string, }
.)