why does WalkBuilder::filter_entry() require a 'static
closure?
#2633
-
ripgrep/crates/ignore/src/walk.rs Line 899 in 7099e17 This argument restriction seems weirdly restrictive to me. Is there any particular reason why the closure one has to pass in has to be a pure function ( |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It doesn't have to be a pure function. The I don't have the specific context, but you might consider changing the signature to what you want and seeing what breaks. Consider, for example, that spawning a thread has a similar restriction. |
Beta Was this translation helpful? Give feedback.
It doesn't have to be a pure function. The
'static
just means it can't borrow anything. That's very different from what a "pure" function is.I don't have the specific context, but you might consider changing the signature to what you want and seeing what breaks. Consider, for example, that spawning a thread has a similar restriction.