address some of flubs comments

This commit is contained in:
Simon Laux
2020-02-11 11:54:04 +01:00
committed by B. Petersen
parent ac4b2b9dfe
commit 2e8409f146
5 changed files with 21 additions and 16 deletions

View File

@@ -961,17 +961,15 @@ impl rusqlite::types::ToSql for ArchiveState {
impl rusqlite::types::FromSql for ArchiveState {
fn column_result(value: rusqlite::types::ValueRef) -> rusqlite::types::FromSqlResult<Self> {
i64::column_result(value).and_then(|val| {
Ok({
match val {
2 => ArchiveState::Pinned,
1 => ArchiveState::Archived,
0 => ArchiveState::Normal,
_ => {
println!("unknown archived state, falling back to normal state (was this db opened with a newer deltachat version?)");
ArchiveState::Normal
},
match val {
2 => Ok(ArchiveState::Pinned),
1 => Ok(ArchiveState::Archived),
0 => Ok(ArchiveState::Normal),
n => {
// unknown archived state, falling back to normal state (was this db opened with a newer deltachat version?)
Err(rusqlite::types::FromSqlError::OutOfRange(n))
}
})
}
})
}
}