cargo fmt
This commit is contained in:
@@ -162,10 +162,22 @@ fn named_date<Tz: TimeZone>(
|
|||||||
// TODO: lots more!
|
// TODO: lots more!
|
||||||
"eod" => Ok((remaining, local_today + Duration::days(1))),
|
"eod" => Ok((remaining, local_today + Duration::days(1))),
|
||||||
"sod" => Ok((remaining, local_today)),
|
"sod" => Ok((remaining, local_today)),
|
||||||
"eow" => Ok((remaining,local_today + Duration::days((6-day_index).into()))),
|
"eow" => Ok((
|
||||||
"eoww" => Ok((remaining,local_today + Duration::days((5-day_index).into()))),
|
remaining,
|
||||||
"sow" => Ok((remaining,local_today + Duration::days((6-day_index).into()))),
|
local_today + Duration::days((6 - day_index).into()),
|
||||||
"soww" => Ok((remaining,local_today + Duration::days((7-day_index).into()))),
|
)),
|
||||||
|
"eoww" => Ok((
|
||||||
|
remaining,
|
||||||
|
local_today + Duration::days((5 - day_index).into()),
|
||||||
|
)),
|
||||||
|
"sow" => Ok((
|
||||||
|
remaining,
|
||||||
|
local_today + Duration::days((6 - day_index).into()),
|
||||||
|
)),
|
||||||
|
"soww" => Ok((
|
||||||
|
remaining,
|
||||||
|
local_today + Duration::days((7 - day_index).into()),
|
||||||
|
)),
|
||||||
_ => Err(Err::Error(Error::new(input, ErrorKind::Tag))),
|
_ => Err(Err::Error(Error::new(input, ErrorKind::Tag))),
|
||||||
}
|
}
|
||||||
.map(|(rem, dt)| (rem, dt.and_hms(0, 0, 0).with_timezone(&Utc)))
|
.map(|(rem, dt)| (rem, dt.and_hms(0, 0, 0).with_timezone(&Utc)))
|
||||||
|
|||||||
@@ -113,9 +113,11 @@ impl<'t> Txn<'t> {
|
|||||||
fn get_next_working_set_number(&self) -> anyhow::Result<usize> {
|
fn get_next_working_set_number(&self) -> anyhow::Result<usize> {
|
||||||
let t = self.get_txn()?;
|
let t = self.get_txn()?;
|
||||||
let next_id: Option<usize> = t
|
let next_id: Option<usize> = t
|
||||||
.query_row("SELECT COALESCE(MAX(id), 0) + 1 FROM working_set", [], |r| {
|
.query_row(
|
||||||
r.get(0)
|
"SELECT COALESCE(MAX(id), 0) + 1 FROM working_set",
|
||||||
})
|
[],
|
||||||
|
|r| r.get(0),
|
||||||
|
)
|
||||||
.optional()
|
.optional()
|
||||||
.context("Getting highest working set ID")?;
|
.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 rows: Vec<Result<(usize, Uuid), _>> = rows.collect();
|
||||||
let mut res = Vec::with_capacity(rows.len());
|
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);
|
res.push(None);
|
||||||
}
|
}
|
||||||
for r in rows {
|
for r in rows {
|
||||||
|
|||||||
Reference in New Issue
Block a user