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

@@ -383,7 +383,7 @@ fn get_rows_to_delete(db: &db::LockedDatabase, stream_id: i32,
return Ok(());
}
let mut n = 0;
db.list_oldest_sample_files(stream_id, |row| {
db.list_oldest_sample_files(stream_id, &mut |row| {
bytes_to_delete += row.sample_file_bytes as i64;
to_delete.push(row);
n += 1;