Derive Default for JwkSet
Useful for creating empty an empty JWKS.
What would be the use case for this change?
What would be the use case for this change?
I want to send an empty JwkSet for whatever reason.
- let empty_set = JwkSet {
- keys: Vec::default(),
- };
+ let empty_set = JwkSet::default();
@tristan957 , I feel like this change is setting someone for failure down the track. An empty JwkSet is a source of potential bugs - the compiler will not be able to reason because the struct is there, but the keys are not.
Making this explicit during the construction of the set feels safer to me.
@tristan957 , I feel like this change is setting someone for failure down the track. An empty JwkSet is a source of potential bugs - the compiler will not be able to reason because the struct is there, but the keys are not.
Making this explicit during the construction of the set feels safer to me.
I'm not sure how someone could be set up for failure. I am requesting an empty JwkSet explicitly. What are the potential bugs here? How is this any different than the example I posted 1 comment ago?
I agree with @rimutaka
I'd rather keep Default for things that are valid. The field is exposed so you can do what you want