Aleph-Alpha/ts-rs

Bug: rename_all for enums doesn't match serde

stegaBOB opened this issue · 4 comments

#184 fixed the issue for struct fields, but enum variants don't have underscores so they will end up all lowercase with camel and pascal case. Serde's implementation has separate logic for enums and structs, so doing the same thing here would probably fix it.

https://github.com/serde-rs/serde/blob/1d54973b928bd8708a4ad2d90fca1203367ff580/serde_derive/src/internals/case.rs#L57

Hey @stegaBOB, thanks for the report! Can you provide an example of the bug?
I'm trying to reproduce it locally but haven't been able to. It does happen as of #184, but it was due to a problem fixed in #198. After which I haven't been able to reproduce the problem.

If it can't be reproduced after #198, this may be a duplicate of #194

Ah! Looking at that fix, it looks like that would do the trick. I should have tried the latest git changes first. Would it be possible to cut a new release?

It might take a while until a relesase comes, @NyxCode has very limited time this month and we also need to merge #233 before releasing

Gotcha