mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-26 00:18:12 +08:00
Use serde to serialize responses (#96)
This commit is contained in:
committed by
Keavon Chambers
parent
f10a3c63d1
commit
f8ebff033d
@@ -2,6 +2,8 @@ use crate::shims::Error;
|
||||
use editor_core::events;
|
||||
use editor_core::tools::{SelectAppendMode, ToolType};
|
||||
use editor_core::Color as InnerColor;
|
||||
use events::Response;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
@@ -24,6 +26,15 @@ impl Color {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct WasmResponse(Response);
|
||||
|
||||
impl WasmResponse {
|
||||
pub fn new(response: Response) -> Self {
|
||||
Self(response)
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! match_string_to_enum {
|
||||
(match ($e:expr) {$($var:ident),* $(,)?}) => {
|
||||
match $e {
|
||||
|
||||
Reference in New Issue
Block a user