Associate WalkDir lifetime with WalkDirOptions, sorter, and IntoIter#203
Associate WalkDir lifetime with WalkDirOptions, sorter, and IntoIter#203dbarnett wants to merge 1 commit intoBurntSushi:masterfrom
Conversation
Narrows lifetime of callbacks for sort_by and sort_by_key so they no longer need to be 'static.
|
Not sure if this is the ideal fix, but it allows narrowing the |
| #[derive(Debug)] | ||
| pub struct WalkDir { | ||
| opts: WalkDirOptions, | ||
| pub struct WalkDir<'slf> { |
There was a problem hiding this comment.
This is a breaking change. And this should also reveal why the WalkDir type requires 'static: so that it isn't itself generic.
This also strikes me as a very odd use of lifetimes and I don't know what kinds of implications it will have on downstream APIs.
There was a problem hiding this comment.
Heh, well most use of lifetimes feels strange to me still... I was hoping in the process of implementing the change and getting your input I'd come to understand whether/how the implications were problematic, if they didn't happen to be trivially close to something workable.
|
K, so from your comments here and on the bug, it seems like it's Working As Intended and |
Narrows lifetime of callbacks for sort_by and sort_by_key so they no longer need to be 'static.
Fixes #202.