summaryrefslogtreecommitdiff
path: root/ext/webstorage/lib.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-04-04 15:07:26 +0530
committerGitHub <noreply@github.com>2022-04-04 15:07:26 +0530
commit797cf9cdd9fa864494cea4ba02edb7be185fe79a (patch)
tree18501a48c6394815e560bb6e2760369768307cd5 /ext/webstorage/lib.rs
parent1f7dd5eda9b5e17ff102abb4dce1f19a4ce76688 (diff)
chore(ext/webstorage): custom arity (#14201)
Diffstat (limited to 'ext/webstorage/lib.rs')
-rw-r--r--ext/webstorage/lib.rs13
1 files changed, 3 insertions, 10 deletions
diff --git a/ext/webstorage/lib.rs b/ext/webstorage/lib.rs
index 7cda0176a..47d720ffb 100644
--- a/ext/webstorage/lib.rs
+++ b/ext/webstorage/lib.rs
@@ -10,7 +10,6 @@ use deno_core::OpState;
use rusqlite::params;
use rusqlite::Connection;
use rusqlite::OptionalExtension;
-use serde::Deserialize;
use std::fmt;
use std::path::PathBuf;
@@ -135,17 +134,11 @@ pub fn op_webstorage_key(
Ok(key)
}
-#[derive(Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct SetArgs {
- key_name: String,
- key_value: String,
-}
-
#[op]
pub fn op_webstorage_set(
state: &mut OpState,
- args: SetArgs,
+ key: String,
+ value: String,
persistent: bool,
) -> Result<(), AnyError> {
let conn = get_webstorage(state, persistent)?;
@@ -165,7 +158,7 @@ pub fn op_webstorage_set(
let mut stmt = conn
.prepare_cached("INSERT OR REPLACE INTO data (key, value) VALUES (?, ?)")?;
- stmt.execute(params![args.key_name, args.key_value])?;
+ stmt.execute(params![key, value])?;
Ok(())
}