Switch to pretty_assertions

This commit is contained in:
Dustin J. Mitchell
2021-10-02 01:01:28 +00:00
parent 267288c9e6
commit a143660124
47 changed files with 130 additions and 17 deletions

View File

@@ -113,9 +113,11 @@ impl<'t> Txn<'t> {
fn get_next_working_set_number(&self) -> anyhow::Result<usize> {
let t = self.get_txn()?;
let next_id: Option<usize> = t
.query_row("SELECT COALESCE(MAX(id), 0) + 1 FROM working_set", [], |r| {
r.get(0)
})
.query_row(
"SELECT COALESCE(MAX(id), 0) + 1 FROM working_set",
[],
|r| r.get(0),
)
.optional()
.context("Getting highest working set ID")?;
@@ -290,7 +292,10 @@ impl<'t> StorageTxn for Txn<'t> {
let rows: Vec<Result<(usize, Uuid), _>> = rows.collect();
let mut res = Vec::with_capacity(rows.len());
for _ in 0..self.get_next_working_set_number().context("Getting working set number")? {
for _ in 0..self
.get_next_working_set_number()
.context("Getting working set number")?
{
res.push(None);
}
for r in rows {
@@ -351,6 +356,7 @@ impl<'t> StorageTxn for Txn<'t> {
mod test {
use super::*;
use crate::storage::taskmap_with;
use pretty_assertions::{assert_eq};
use tempfile::TempDir;
#[test]