Closed laumann closed 6 years ago
np :-) My only worry is the unwrap()
- could that cause any problems, do you think?
@laumann Oh! Thanks so much for pointing that out, I completely missed that. Yeah, we definitely can't do that. Which means you can't borrow the function mutably, which in turn means you can't call it. So we have three choices:
FnMut
into Fn
.Arc<Mutex<FnMut(...)>>
instead of Arc<FnMut(...)>
.WalkDir
cloneable.I'm inclined to go with option (3) for a variety of reasons that have kind of already been hashed out. That is, we want calls to be able to do mutation inside the closure, and adding the overhead of a mutex to the sorting function isn't acceptable I think. So I think this PR can be closed. :-(
That's OK. It seemed so simple... :-)
Fixes #54
I tried out @BurntSushi's suggestion to use
Arc
and it seems to work.