mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 07:28:12 +08:00
Use serde to serialize responses (#96)
This commit is contained in:
committed by
Keavon Chambers
parent
9ad5f4ce78
commit
721a442b75
@@ -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