Skip to content

Commit

Permalink
Fix non-exhaustive error (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
kearfy authored May 14, 2024
1 parent 6735cb4 commit 2d2a49d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ use cbor::Cbor;
use futures::StreamExt;
use opt::endpoint::Options;
use serde_wasm_bindgen::from_value;
use surrealdb::dbs::Notification;
use surrealdb::dbs::Session;
use surrealdb::kvs::Datastore;
use surrealdb::rpc::format::cbor;
use surrealdb::rpc::method::Method;
use surrealdb::rpc::{Data, RpcContext};
use surrealdb::sql::{Object, Value};
use surrealdb::dbs::Notification;
use types::TsConnectionOptions;
use uuid::Uuid;
use wasm_bindgen::prelude::wasm_bindgen;
Expand Down Expand Up @@ -53,7 +53,9 @@ impl SurrealWasmEngine {
message.insert("result".to_string(), notification.result);

// Into CBOR value
let cbor: Cbor = Value::Object(message).try_into().map_err(|_| JsValue::from_str("Failed to convert notification to CBOR"))?;
let cbor: Cbor = Value::Object(message)
.try_into()
.map_err(|_| JsValue::from_str("Failed to convert notification to CBOR"))?;
let mut res = Vec::new();
ciborium::into_writer(&cbor.0, &mut res).unwrap();
let out_arr: Uint8Array = res.as_slice().into();
Expand Down Expand Up @@ -88,10 +90,7 @@ impl SurrealWasmEngine {

let inner = SurrealWasmEngineInner {
kvs,
session: Session {
rt: true,
..Default::default()
},
session: Session::default().with_rt(true),
vars: Default::default(),
};

Expand Down

0 comments on commit 2d2a49d

Please sign in to comment.