Fix up some possible lifetime issues in newer editions#707
Fix up some possible lifetime issues in newer editions#707
Conversation
| ($logger:expr) => {{ | ||
| &($logger) | ||
| }}; | ||
| ($logger:expr) => {&($logger)}; |
There was a problem hiding this comment.
The code block shouldn't matter right? (fine with the code change though)
There was a problem hiding this comment.
You'd think not, but this is one of the edition-based lifetime changes. In the 2024 edition, this borrow is for a lifetime that doesn't outlive the block.
| // Types for the `kv` argument. | ||
|
|
||
| impl<'a> KVs<'a> for &'a [(&'a str, Value<'a>)] { | ||
| impl<'a, const N: usize> KVs<'a> for &'a [(&'a str, Value<'a>); N] { |
There was a problem hiding this comment.
I'm fine with the change. I do wonder if this changes the binary size as now create code per N/size, but I don't know if this will impact anything.
There was a problem hiding this comment.
I couldn't actually trigger the same build failure reported in #706 yet, so this one is purely speculative right now.
The change in code size is a good point, I'll measure it and see what impact it has. I wouldn't be surprised if it made no difference, but is definitely worth checking.
For #706