Formatting
This commit is contained in:
1 parent
dddac01bdf
commit
10cf7f0d2e
29 files changed
+138
-138
No files matched your search
@@ -17,11 +17,7 @@ pub fn get_setting(key: String, connection: &Connection) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn set_setting(
|
||||
key: String,
|
||||
value: String,
|
||||
connection: &Connection,
|
||||
) -> MaybeError {
|
||||
pub fn set_setting(key: String, value: String, connection: &Connection) -> MaybeError {
|
||||
let current = get_settings_list(connection)?;
|
||||
if current.contains(&key) {
|
||||
update_settings(key, value, connection)?;
|
||||
@@ -39,11 +35,7 @@ pub fn delete_settings(key: String, connection: &Connection) -> MaybeError {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn create_settings(
|
||||
key: String,
|
||||
value: String,
|
||||
connection: &Connection,
|
||||
) -> MaybeError {
|
||||
fn create_settings(key: String, value: String, connection: &Connection) -> MaybeError {
|
||||
connection
|
||||
.execute(
|
||||
"INSERT into settings (id, value) VALUES (?1, ?2)",
|
||||
@@ -53,11 +45,7 @@ fn create_settings(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn update_settings(
|
||||
key: String,
|
||||
value: String,
|
||||
connection: &Connection,
|
||||
) -> MaybeError {
|
||||
fn update_settings(key: String, value: String, connection: &Connection) -> MaybeError {
|
||||
connection
|
||||
.execute(
|
||||
"update settings
|
||||
|
||||
Reference in new issue
Block a user