take FnMut closures by reference

I mistakenly thought these had to be monomorphized. (The FnOnce still
does, until rust-lang/rfcs#1909 is implemented.) Turns out this way works
fine. It should result in less compile time / code size, though I didn't check
this.
This commit is contained in:
Scott Lamb
2018-02-23 09:19:42 -08:00
parent d9841fd634
commit 843e1b49c8
6 changed files with 29 additions and 27 deletions

View File

@@ -1788,7 +1788,7 @@ mod tests {
let all_time = recording::Time(i64::min_value()) .. recording::Time(i64::max_value());
{
let db = tdb.db.lock();
db.list_recordings_by_time(TEST_STREAM_ID, all_time, |r| {
db.list_recordings_by_time(TEST_STREAM_ID, all_time, &mut |r| {
let d = r.duration_90k;
assert!(skip_90k + shorten_90k < d);
builder.append(&*db, r, skip_90k .. d - shorten_90k).unwrap();
@@ -2252,7 +2252,7 @@ mod bench {
let segment = {
let all_time = recording::Time(i64::min_value()) .. recording::Time(i64::max_value());
let mut row = None;
db.list_recordings_by_time(testutil::TEST_STREAM_ID, all_time, |r| {
db.list_recordings_by_time(testutil::TEST_STREAM_ID, all_time, &mut |r| {
row = Some(r);
Ok(())
}).unwrap();