mirror of
https://github.com/creating2morrow/neveko.git
synced 2024-12-22 11:39:22 +00:00
add serialization to write_gui_db
This commit is contained in:
parent
f95b3e7548
commit
1f94d40f9f
1 changed files with 2 additions and 1 deletions
|
@ -782,7 +782,8 @@ pub fn search_gui_db(f: String, data: String) -> Result<String, MdbError> {
|
||||||
pub fn write_gui_db(f: String, key: String, data: String) -> Result<(), MdbError> {
|
pub fn write_gui_db(f: String, key: String, data: String) -> Result<(), MdbError> {
|
||||||
let db = &DATABASE_LOCK;
|
let db = &DATABASE_LOCK;
|
||||||
let k = format!("{}-{}", f, key);
|
let k = format!("{}-{}", f, key);
|
||||||
db::write_chunks(&db.env, &db.handle, k.as_bytes(), data.as_bytes())?;
|
let v = bincode::serialize(&data).unwrap_or_default();
|
||||||
|
db::write_chunks(&db.env, &db.handle, k.as_bytes(), &v)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue