Update to Rust programming language.

This commit is contained in:
Abraham 2023-04-27 00:28:36 +05:00
parent 943efbfbdb
commit f88248643b
201 changed files with 12954 additions and 1690 deletions

View file

@ -0,0 +1,19 @@
use crate::DB;
#[tauri::command]
pub fn db_read(key: &str) -> String {
if let Some(value) = DB.lock().unwrap().get(key) {
value
} else {
String::from("")
}
}
#[tauri::command]
pub fn db_write(key: &str, val: &str) -> bool {
if let Ok(_) = DB.lock().unwrap().set(key, &val) {
true
} else {
false
}
}