mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-29 21:33:31 -05:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user