Breathe life back into this project. #1
1 changed files with 9 additions and 7 deletions
|
@ -64,13 +64,15 @@ impl SyncMetadata {
|
|||
}
|
||||
|
||||
pub fn remote_head(tx: &rusqlite::Transaction) -> Result<Uuid> {
|
||||
Uuid::from_bytes(
|
||||
tx.query_row(
|
||||
"SELECT value FROM tolstoy_metadata WHERE key = ?",
|
||||
&[&schema::REMOTE_HEAD_KEY], |r| {
|
||||
rusqlite::params![&schema::REMOTE_HEAD_KEY], |r| {
|
||||
let bytes: Vec<u8> = r.get(0).unwrap();
|
||||
Uuid::from_bytes(bytes.as_slice())
|
||||
Ok(bytes)
|
||||
}
|
||||
)?.map_err(|e| e.into())
|
||||
)?.as_slice()
|
||||
).map_err(|e| e.into())
|
||||
}
|
||||
|
||||
pub fn set_remote_head(tx: &rusqlite::Transaction, uuid: &Uuid) -> Result<()> {
|
||||
|
|
Loading…
Reference in a new issue