Keats / jsonwebtoken

JWT lib in rust
MIT License
1.69k stars 271 forks source link

fix issue 120: DecodingKey can be converted to static #123

Closed Hexilee closed 4 years ago

Hexilee commented 4 years ago

I ran into #120 as well, so did a little changes.

Keats commented 4 years ago

Thanks for that! Can we remove the changes to 'static for now as it is a breaking change and only have the CoW + into_static? That would make it easier to use without a breaking change I think?

Hexilee commented 4 years ago

Of course, I reverted it.

Hexilee commented 4 years ago

Excuse me, but, can we merge this PR and publish a new version as soon as possible? I really need it.

Keats commented 4 years ago

@MayaWolf and @tjwilson90 would this PR work for you?

tjwilson90 commented 4 years ago

Yes, this looks good.

code-elf commented 4 years ago

I went for a different approach in my fork, where the DecodingKey and EncodingKey construction methods consume/move their parameters, which I think is the most versatile option - but that would be a breaking change, so if you're interested it's probably better to hold off until a major version bump.

Keats commented 4 years ago

I think I prefer the approach of @Hexilee on that, making things Cow instead of owned so we don't need to clone when we can avoid it. That will be a change for the next version whenever it happens.