From 5ad5eb37f127fc091fb34d01f3dca2b3c4af1b5f Mon Sep 17 00:00:00 2001 From: Filipe Rodrigues Date: Wed, 13 May 2020 15:02:46 +0100 Subject: [PATCH] Removed `card-editor`. Changed `err-impl` to a git dependency. --- Cargo.lock | 897 ++++------------------------------------ Cargo.toml | 22 +- src/card-editor/cli.rs | 41 -- src/card-editor/main.rs | 282 ------------- 4 files changed, 76 insertions(+), 1166 deletions(-) delete mode 100644 src/card-editor/cli.rs delete mode 100644 src/card-editor/main.rs diff --git a/Cargo.lock b/Cargo.lock index 2c58cb7..4fff96b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,25 +1,5 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -[[package]] -name = "andrew" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" -dependencies = [ - "bitflags", - "line_drawing", - "rusttype 0.7.9", - "walkdir", - "xdg", - "xml-rs", -] - -[[package]] -name = "android_glue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" - [[package]] name = "ansi_term" version = "0.11.0" @@ -29,15 +9,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "approx" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" -dependencies = [ - "num-traits", -] - [[package]] name = "arrayref" version = "0.3.6" @@ -76,28 +47,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" -[[package]] -name = "backtrace" -version = "0.3.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e692897359247cc6bb902933361652380af0f1b7651ae5c5013407f30e109e" -dependencies = [ - "backtrace-sys", - "cfg-if", - "libc", - "rustc-demangle", -] - -[[package]] -name = "backtrace-sys" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fbebbe1c9d1f383a9cc7e8ccdb471b91c8d024ee9c2ca5b5346121fe8b4399" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "base64" version = "0.11.0" @@ -121,40 +70,18 @@ dependencies = [ "constant_time_eq", ] -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - [[package]] name = "byteorder" version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" -[[package]] -name = "cc" -version = "1.0.52" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d" - [[package]] name = "cfg-if" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" -[[package]] -name = "cgl" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55e7ec0b74fe5897894cbc207092c577e87c52f8a59e8ca8d97ef37551f60a49" -dependencies = [ - "gleam", - "libc", -] - [[package]] name = "chrono" version = "0.4.11" @@ -175,70 +102,18 @@ dependencies = [ "ansi_term", "atty", "bitflags", - "strsim 0.8.0", + "strsim", "textwrap", "unicode-width", "vec_map", ] -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - -[[package]] -name = "cocoa" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1706996401131526e36b3b49f0c4d912639ce110996f3ca144d78946727bce54" -dependencies = [ - "bitflags", - "block", - "core-foundation", - "core-graphics", - "foreign-types", - "libc", - "objc", -] - [[package]] name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" -[[package]] -name = "core-foundation" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" - -[[package]] -name = "core-graphics" -version = "0.17.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9" -dependencies = [ - "bitflags", - "core-foundation", - "foreign-types", - "libc", -] - [[package]] name = "crossbeam-utils" version = "0.7.2" @@ -273,21 +148,17 @@ dependencies = [ "derive_more", "err-backtrace", "err-ext", + "err-impl", "err-panic", "float-ord", - "gfx", - "gfx_device_gl", - "gfx_window_glutin", - "glutin", - "imgui", - "imgui-gfx-renderer", - "imgui-winit-support", "itertools", "log", + "rand", + "serde", "serde_yaml", "simplelog", + "smart-default", "string-err", - "strsim 0.10.0", ] [[package]] @@ -296,8 +167,8 @@ version = "0.99.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2323f3f47db9a0e77ce7a300605d8d2098597fc451ed1a97bb1f6411bb550a7" dependencies = [ - "proc-macro2 1.0.10", - "quote 1.0.3", + "proc-macro2", + "quote", "syn", ] @@ -323,30 +194,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "dlib" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a" -dependencies = [ - "libloading", -] - -[[package]] -name = "downcast-rs" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6" - -[[package]] -name = "draw_state" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33cf9537e2d06891448799b96d5a8c8083e0e90522a7fdabe6ebf4f41d79d651" -dependencies = [ - "bitflags", -] - [[package]] name = "dtoa" version = "0.4.5" @@ -370,10 +217,11 @@ version = "0.1.0" [[package]] name = "err-impl" version = "0.1.0" +source = "git+https://github.com/Zenithsiz/err-impl#188a95b85272fc087794c7f7f0972e146a1d350e" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.10", - "quote 1.0.3", + "proc-macro2", + "quote", "syn", "synstructure", ] @@ -391,21 +239,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bad48618fdb549078c333a7a8528acb57af271d0433bdecd523eb620628364e" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "getrandom" version = "0.1.14" @@ -417,161 +250,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "gfx" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01de46f9508a5c259aef105f0bff760ceddca832ea9c87ce03d1923e22ee155b" -dependencies = [ - "draw_state", - "gfx_core", - "log", -] - -[[package]] -name = "gfx_core" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75fbddaef2e12b4995900539d7209d947b988a3d87ee8737484d049b526e5441" -dependencies = [ - "bitflags", - "draw_state", - "log", -] - -[[package]] -name = "gfx_device_gl" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c385fa380c18888633aa27d1e16cbae518469702a2f69dcb5f52d5378bebc" -dependencies = [ - "gfx_core", - "gfx_gl", - "log", -] - -[[package]] -name = "gfx_gl" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d38164670920cfb7491bc0cf6f49f0554bd1c44cdbedc6c78d2bf91691ff5e" -dependencies = [ - "gl_generator 0.14.0", -] - -[[package]] -name = "gfx_window_glutin" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310ff66f08b5a55854b18fea2f48bdbb75c94458207ba574c9723be78e97a646" -dependencies = [ - "gfx_core", - "gfx_device_gl", - "glutin", -] - -[[package]] -name = "gl_generator" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca98bbde17256e02d17336a6bdb5a50f7d0ccacee502e191d3e3d0ec2f96f84a" -dependencies = [ - "khronos_api", - "log", - "xml-rs", -] - -[[package]] -name = "gl_generator" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" -dependencies = [ - "khronos_api", - "log", - "xml-rs", -] - -[[package]] -name = "gleam" -version = "0.6.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cae10d7c99d0e77b4766e850a60898a17c1abaf01075531f1066f03dc7dc5fc5" -dependencies = [ - "gl_generator 0.13.1", -] - -[[package]] -name = "glutin" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5371b35b309dace06be1b81b5f6adb1c9de578b7dbe1e74bf7e4ef762cf6febd" -dependencies = [ - "android_glue", - "cgl", - "cocoa", - "core-foundation", - "core-graphics", - "glutin_egl_sys", - "glutin_emscripten_sys", - "glutin_gles2_sys", - "glutin_glx_sys", - "glutin_wgl_sys", - "lazy_static", - "libloading", - "objc", - "osmesa-sys", - "parking_lot 0.9.0", - "wayland-client", - "winapi", - "winit", -] - -[[package]] -name = "glutin_egl_sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772edef3b28b8ad41e4ea202748e65eefe8e5ffd1f4535f1219793dbb20b3d4c" -dependencies = [ - "gl_generator 0.13.1", - "winapi", -] - -[[package]] -name = "glutin_emscripten_sys" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80de4146df76e8a6c32b03007bc764ff3249dcaeb4f675d68a06caf1bac363f1" - -[[package]] -name = "glutin_gles2_sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e853d96bebcb8e53e445225c3009758c6f5960d44f2543245f6f07b567dae0" -dependencies = [ - "gl_generator 0.13.1", - "objc", -] - -[[package]] -name = "glutin_glx_sys" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c243de74d6cf5ea100c788826d2fb9319de315485dd4b310811a663b3809c3" -dependencies = [ - "gl_generator 0.13.1", - "x11-dl", -] - -[[package]] -name = "glutin_wgl_sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a93dba7ee3a0feeac0f437141ff25e71ce2066bcf1a706acab1559ffff94eb6a" -dependencies = [ - "gl_generator 0.13.1", -] - [[package]] name = "hermit-abi" version = "0.1.10" @@ -581,49 +259,6 @@ dependencies = [ "libc", ] -[[package]] -name = "imgui" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2d28cee2982d4dab4dd954c23be339ab1f98be4ff5a13ecd8fbfb47cdfa23a" -dependencies = [ - "bitflags", - "gfx", - "imgui-sys", - "lazy_static", - "parking_lot 0.10.2", -] - -[[package]] -name = "imgui-gfx-renderer" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "506eae7244a06bc18273634d1c30e070bdf592f5e7fb1f6871d062ad17a4b2ec" -dependencies = [ - "gfx", - "imgui", - "winapi", -] - -[[package]] -name = "imgui-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a8693e0f66ecd2ec10e2f0ed4dc4519071495f350e6d8ddaf3e70351229257" -dependencies = [ - "cc", -] - -[[package]] -name = "imgui-winit-support" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5685c7d17aee9555377f9c4f7b6fac96899a7015f6b41950c613a3df034aff08" -dependencies = [ - "imgui", - "winit", -] - [[package]] name = "itertools" version = "0.9.0" @@ -633,12 +268,6 @@ dependencies = [ "either", ] -[[package]] -name = "khronos_api" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" - [[package]] name = "lazy_static" version = "1.4.0" @@ -651,40 +280,12 @@ version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0" -[[package]] -name = "libloading" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi", -] - -[[package]] -name = "line_drawing" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" -dependencies = [ - "num-traits", -] - [[package]] name = "linked-hash-map" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] - [[package]] name = "log" version = "0.4.8" @@ -694,44 +295,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - -[[package]] -name = "memmap" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "nix" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" -dependencies = [ - "bitflags", - "cc", - "cfg-if", - "libc", - "void", -] - [[package]] name = "num-integer" version = "0.1.42" @@ -752,93 +315,10 @@ dependencies = [ ] [[package]] -name = "objc" -version = "0.2.7" +name = "ppv-lite86" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", -] - -[[package]] -name = "ordered-float" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" -dependencies = [ - "num-traits", -] - -[[package]] -name = "osmesa-sys" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" -dependencies = [ - "shared_library", -] - -[[package]] -name = "parking_lot" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" -dependencies = [ - "lock_api", - "parking_lot_core 0.6.2", - "rustc_version", -] - -[[package]] -name = "parking_lot" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" -dependencies = [ - "lock_api", - "parking_lot_core 0.7.2", -] - -[[package]] -name = "parking_lot_core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" -dependencies = [ - "cfg-if", - "cloudabi", - "libc", - "redox_syscall", - "rustc_version", - "smallvec 0.6.13", - "winapi", -] - -[[package]] -name = "parking_lot_core" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" -dependencies = [ - "cfg-if", - "cloudabi", - "libc", - "redox_syscall", - "smallvec 1.4.0", - "winapi", -] - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "pkg-config" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" +checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" [[package]] name = "proc-macro-error" @@ -847,8 +327,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98e9e4b82e0ef281812565ea4751049f1bdcdfccda7d3f459f2e138a40c08678" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.10", - "quote 1.0.3", + "proc-macro2", + "quote", "syn", "version_check", ] @@ -859,38 +339,20 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f5444ead4e9935abd7f27dc51f7e852a0569ac888096d5ec2499470794e2e53" dependencies = [ - "proc-macro2 1.0.10", - "quote 1.0.3", + "proc-macro2", + "quote", "syn", "syn-mid", "version_check", ] -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - [[package]] name = "proc-macro2" version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3" dependencies = [ - "unicode-xid 0.2.0", -] - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", + "unicode-xid", ] [[package]] @@ -899,16 +361,48 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" dependencies = [ - "proc-macro2 1.0.10", + "proc-macro2", ] [[package]] -name = "raw-window-handle" -version = "0.3.3" +name = "rand" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ + "getrandom", "libc", + "rand_chacha", + "rand_core", + "rand_hc", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core", ] [[package]] @@ -940,71 +434,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "rustc-demangle" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver", -] - -[[package]] -name = "rusttype" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" -dependencies = [ - "rusttype 0.8.3", -] - -[[package]] -name = "rusttype" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f61411055101f7b60ecf1041d87fb74205fb20b0c7a723f07ef39174cf6b4c0" -dependencies = [ - "approx", - "ordered-float", - "stb_truetype", -] - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" version = "1.0.106" @@ -1020,8 +449,8 @@ version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c" dependencies = [ - "proc-macro2 1.0.10", - "quote 1.0.3", + "proc-macro2", + "quote", "syn", ] @@ -1037,16 +466,6 @@ dependencies = [ "yaml-rust", ] -[[package]] -name = "shared_library" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" -dependencies = [ - "lazy_static", - "libc", -] - [[package]] name = "simplelog" version = "0.7.5" @@ -1059,44 +478,14 @@ dependencies = [ ] [[package]] -name = "smallvec" -version = "0.6.13" +name = "smart-default" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" dependencies = [ - "maybe-uninit", -] - -[[package]] -name = "smallvec" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" - -[[package]] -name = "smithay-client-toolkit" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ccb8c57049b2a34d2cc2b203fa785020ba0129d31920ef0d317430adaf748fa" -dependencies = [ - "andrew", - "bitflags", - "dlib", - "lazy_static", - "memmap", - "nix", - "wayland-client", - "wayland-commons", - "wayland-protocols", -] - -[[package]] -name = "stb_truetype" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" -dependencies = [ - "byteorder", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1111,21 +500,15 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "syn" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03" dependencies = [ - "proc-macro2 1.0.10", - "quote 1.0.3", - "unicode-xid 0.2.0", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] @@ -1134,8 +517,8 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" dependencies = [ - "proc-macro2 1.0.10", - "quote 1.0.3", + "proc-macro2", + "quote", "syn", ] @@ -1145,10 +528,10 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" dependencies = [ - "proc-macro2 1.0.10", - "quote 1.0.3", + "proc-macro2", + "quote", "syn", - "unicode-xid 0.2.0", + "unicode-xid", ] [[package]] @@ -1187,12 +570,6 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unicode-xid" version = "0.2.0" @@ -1211,88 +588,12 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "walkdir" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wayland-client" -version = "0.21.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49963e5f9eeaf637bfcd1b9f0701c99fd5cd05225eb51035550d4272806f2713" -dependencies = [ - "bitflags", - "downcast-rs", - "libc", - "nix", - "wayland-commons", - "wayland-scanner", - "wayland-sys", -] - -[[package]] -name = "wayland-commons" -version = "0.21.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40c08896768b667e1df195d88a62a53a2d1351a1ed96188be79c196b35bb32ec" -dependencies = [ - "nix", - "wayland-sys", -] - -[[package]] -name = "wayland-protocols" -version = "0.21.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afde2ea2a428eee6d7d2c8584fdbe8b82eee8b6c353e129a434cd6e07f42145" -dependencies = [ - "bitflags", - "wayland-client", - "wayland-commons", - "wayland-scanner", - "wayland-sys", -] - -[[package]] -name = "wayland-scanner" -version = "0.21.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf3828c568714507315ee425a9529edc4a4aa9901409e373e9e0027e7622b79e" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "xml-rs", -] - -[[package]] -name = "wayland-sys" -version = "0.21.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520ab0fd578017a0ee2206623ba9ef4afe5e8f23ca7b42f6acfba2f4e66b1628" -dependencies = [ - "dlib", - "lazy_static", -] - [[package]] name = "winapi" version = "0.3.8" @@ -1309,70 +610,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "winit" -version = "0.19.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e96eb4bb472fa43e718e8fa4aef82f86cd9deac9483a1e1529230babdb394a8" -dependencies = [ - "android_glue", - "backtrace", - "bitflags", - "cocoa", - "core-foundation", - "core-graphics", - "lazy_static", - "libc", - "log", - "objc", - "parking_lot 0.9.0", - "percent-encoding", - "raw-window-handle", - "smithay-client-toolkit", - "wayland-client", - "winapi", - "x11-dl", -] - -[[package]] -name = "x11-dl" -version = "2.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" -dependencies = [ - "lazy_static", - "libc", - "maybe-uninit", - "pkg-config", -] - -[[package]] -name = "xdg" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" - -[[package]] -name = "xml-rs" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" - [[package]] name = "yaml-rust" version = "0.4.3" diff --git a/Cargo.toml b/Cargo.toml index f5dc41e..93c3753 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,21 +12,17 @@ path = "src/extractor/main.rs" name = "patcher" path = "src/patcher/main.rs" -[[bin]] -name = "card-editor" -path = "src/card-editor/main.rs" - [dependencies] # Dcb dcb = { path = "../dcb" } # Text ascii = "1.0" -strsim = "0.10" # Helpers float-ord = "0.2" itertools = "0.9" +rand = "0.7" # Cmd clap = "2.33" @@ -40,24 +36,18 @@ string-err = "0.1" err-backtrace = { path = "../err-backtrace" } err-panic = { path = "../err-panic", features = ["string-err-ext"] } err-ext = { path = "../err-ext" } +err-impl = { git = "https://github.com/Zenithsiz/err-impl" } + +# Derives derive_more = "0.99" +smart-default = "0.6" # Serde +serde = "1.0" serde_yaml = "0.8" -# Window / Ui -gfx = "0.18" -gfx_device_gl = "0.16" -gfx_window_glutin = "0.31" -glutin = "0.21" -#image = "0.23" -imgui = "0.3" -imgui-gfx-renderer = "0.3" -imgui-winit-support = { version = "0.3", default-features = false, features = ["winit-19"] } - # Build dependencies in release mode [profile.dev.package."*"] opt-level = 2 [profile.dev.package.dcb] # Except dcb for debugging opt-level = 0 - diff --git a/src/card-editor/cli.rs b/src/card-editor/cli.rs deleted file mode 100644 index cebe9e7..0000000 --- a/src/card-editor/cli.rs +++ /dev/null @@ -1,41 +0,0 @@ -//! Cli manager for the extractor - -// Filesystem -use std::path::{Path, PathBuf}; - -// Clap -use clap::{App as ClapApp, Arg as ClapArg}; - -/// Data from the command line -#[derive(PartialEq, Clone, Debug)] -pub struct CliData { - /// The data directory - pub data_dir: PathBuf, -} - -impl CliData { - /// Constructs all of the cli data given and returns it - pub fn new() -> Self { - // Get all matches from cli - let matches = ClapApp::new("Dcb Card Editor") - .version("0.0") - .author("Filipe [...] <[...]@gmail.com>") - .about("Edits card data from Digimon Digital Card Battle extracted files") - .arg( - ClapArg::with_name("INPUT") - .help("Sets the Data directory to use") - .short("i") - .long("input") - .index(1) - .takes_value(true) - .required(true), - ) - .get_matches(); - - // Get the data dir as either an input or the current directory - let data_dir = matches.value_of("INPUT").map_or_else(|| Path::new("."), Path::new).to_path_buf(); - - // Return the cli data - Self { data_dir } - } -} diff --git a/src/card-editor/main.rs b/src/card-editor/main.rs deleted file mode 100644 index 302c531..0000000 --- a/src/card-editor/main.rs +++ /dev/null @@ -1,282 +0,0 @@ -//! Data patches -//! -//! # Details -//! Patches data to the game file from several other files. -//! -//! # Syntax -//! The executable may be called as `./patcher ` -//! -//! Use the command `./patcher --help` for more information. -//! -//! # Data patched -//! Currently only the following is patched: -//! - Card table - -// Features -#![feature(box_syntax, backtrace, panic_info_message, bool_to_option)] -// Lints -#![warn(clippy::restriction, clippy::pedantic, clippy::nursery)] -#![allow( - clippy::implicit_return, // We prefer implicit returns where possible - clippy::module_name_repetitions, // This happens often due to separating things into modules finely - clippy::wildcard_enum_match_arm, // We only use wildcards when we truly only care about some variants - clippy::result_expect_used, - clippy::option_expect_used, // We use expect when there is no alternative. - clippy::used_underscore_binding, // Useful for macros and such - clippy::integer_arithmetic, - clippy::float_arithmetic, // We need to use numbers my guy - clippy::as_conversions, - clippy::cast_sign_loss, - clippy::cast_possible_wrap, - clippy::cast_possible_truncation, // Needed for converting between stuff - clippy::items_after_statements, -)] - -// Modules -mod cli; -#[path = "../logger.rs"] -mod logger; -#[path = "../panic.rs"] -mod panic; - -// Gfx / GLutin -use gfx::Device; -use glutin::{Event, WindowEvent}; - -// Imgui -use imgui::{Context, FontConfig, FontGlyphRanges, FontSource, ImString}; -use imgui_gfx_renderer::{Renderer, Shaders}; -use imgui_winit_support::{HiDpiMode, WinitPlatform}; - -// Errors -use err_backtrace::ErrBacktraceExt; -use err_ext::ResultExt; -use err_panic::ErrorExtPanic; - -// Itertools -use itertools::Itertools; - -// Dcb -use dcb::game::{card::Table as CardTable, deck::Table as DeckTable}; - -#[allow(clippy::too_many_lines)] // TODO: Fix -fn main() { - // Initialize the logger and set the panic handler - logger::init(); - std::panic::set_hook(box panic::log_handler); - - // Get all data from cli - let cli::CliData { data_dir } = cli::CliData::new(); - - // Load all data files - let cards_table_file = std::fs::File::open(data_dir.join("cards.yaml")).panic_err_msg("Unable to open `cards.yaml`"); - let decks_table_file = std::fs::File::open(data_dir.join("decks.yaml")).panic_err_msg("Unable to open `decks.yaml`"); - - // Parse everything from yaml - let mut cards_table: CardTable = serde_yaml::from_reader(cards_table_file).panic_err_msg("Unable to parse `cards.yaml`"); - let decks_table: DeckTable = serde_yaml::from_reader(decks_table_file).panic_err_msg("Unable to parse `decks.yaml`"); - - // Create a new window - let mut events_loop = glutin::EventsLoop::new(); - let builder = glutin::WindowBuilder::new() - .with_title("Dcb Card Editor") - .with_dimensions(glutin::dpi::LogicalSize::new(1024.0, 768.0)); - let context = glutin::ContextBuilder::new().with_vsync(true); - let (windowed_context, mut device, mut factory, mut main_color, mut main_depth) = - gfx_window_glutin::init::(builder, context, &events_loop) - .panic_err_msg("Failed to initialize graphics"); - let mut encoder: gfx::Encoder<_, _> = factory.create_command_buffer().into(); - let shaders = { - let version = device.get_info().shading_language; - if version.is_embedded { - if version.major >= 3 { - Shaders::GlSlEs300 - } else { - Shaders::GlSlEs100 - } - } else if version.major >= 4 { - Shaders::GlSl400 - } else if version.major >= 3 { - if version.minor >= 2 { - Shaders::GlSl150 - } else { - Shaders::GlSl130 - } - } else { - Shaders::GlSl110 - } - }; - - // Create a new context for `imgui` - let mut imgui_context = Context::create(); - let mut platform = WinitPlatform::init(&mut imgui_context); - - // Add our font to imgui - let hidpi_factor = platform.hidpi_factor(); - let font_size = (13.0 * hidpi_factor) as f32; - imgui_context.fonts().add_font(&[ - FontSource::DefaultFontData { - config: Some(FontConfig { - size_pixels: font_size, - ..FontConfig::default() - }), - }, - FontSource::TtfData { - data: include_bytes!("../../resources/OpenSans-Regular.ttf"), - size_pixels: font_size, - config: Some(FontConfig { - rasterizer_multiply: 1.75, - glyph_ranges: FontGlyphRanges::japanese(), - ..FontConfig::default() - }), - }, - ]); - imgui_context.io_mut().font_global_scale = (1.0 / hidpi_factor) as f32; - - // Fix `sRGB` on style colors - let style = imgui_context.style_mut(); - #[allow(clippy::indexing_slicing)] // False positive, this is a `[f32; 4]` - for color in style.colors.iter_mut() { - color[0] = color[0].powf(2.2); - color[1] = color[1].powf(2.2); - color[2] = color[2].powf(2.2); - color[3] = 1.0 - (1.0 - color[3]).powf(2.2); - } - - // Attach the window to the platform - let mut renderer = Renderer::init(&mut imgui_context, &mut factory, shaders).panic_err_msg("Unable to initialize renderer"); - platform.attach_window(imgui_context.io_mut(), windowed_context.window(), HiDpiMode::Rounded); - - let mut last_frame = std::time::Instant::now(); - let mut run = true; - - // Get all digimon names as `ImString`s - let mut digimon_names: Vec<_> = cards_table.digimons.iter().map(|digimon| ImString::new(digimon.name.clone())).collect(); - let mut digimon_filter_idx = 0; - let mut digimon_filter_search = ImString::new(""); - - while run { - // Check for events - events_loop.poll_events(|event| { - platform.handle_event(imgui_context.io_mut(), windowed_context.window(), &event); - - if let Event::WindowEvent { event, .. } = event { - match event { - WindowEvent::Resized(_) => { - gfx_window_glutin::update_views(&windowed_context, &mut main_color, &mut main_depth); - }, - WindowEvent::CloseRequested => run = false, - _ => (), - } - } - }); - - // Prepare and execute ui frame - let io = imgui_context.io_mut(); - platform - .prepare_frame(io, windowed_context.window()) - .ignore_with_err(|err| log::warn!("Unable to prepare frame: {}", err)); - last_frame = io.update_delta_time(last_frame); - let ui = imgui_context.frame(); - { - ui.text("Digimon: "); - - ui.input_text(imgui::im_str!("Digimon Filter"), &mut digimon_filter_search) - .resize_buffer(true) - .build(); - - let digimon_filters: Vec<_> = digimon_names - .iter() - .enumerate() - .map(|(idx, string)| { - ( - float_ord::FloatOrd(1.0 - strsim::jaro(string.to_str(), digimon_filter_search.to_str())), - string, - idx, - ) - }) - .sorted() - .collect(); - - let digimon_filter_names: Vec<_> = digimon_filters - .iter() - .filter_map(|(value, string, _)| (digimon_filter_search.is_empty() || value.0 < 0.5).then_some(string)) - .collect(); - - ui.list_box( - imgui::im_str!("Digimon List"), - &mut digimon_filter_idx, - digimon_filter_names.as_slice(), - 4, - ); - - ui.separator(); - - /* - if let Some((_, _, idx)) = digimon_filters.get(digimon_filter_idx as usize) { - let idx = *idx; - std::mem::drop(digimon_filters); - if let Some(digimon_name_buffer) = digimon_names.get_mut(idx) { - if ui.input_text(imgui::im_str!("Name"), digimon_name_buffer).resize_buffer(true).build() { - if let Some(digimon) = cards_table.digimons.get_mut(idx) { - match ascii::AsciiString::from_ascii(digimon_name_buffer.to_string()) { - Ok(name) => { - digimon.name = name; - }, - Err(err) => { - ui.text(format!("Unable to set digimon name:\n{}", err.err_backtrace())); - }, - } - } - } - } - } - */ - - //if let Some(digimon_name) = digimon_names.iter_mut().enumerate().find(|(_, name)| name == ) - - /* - if let Some((idx, digimon)) = cards_table.digimons.iter_mut().enumerate().find(|(_, digimon)| { - digimon_filter_names - .get(digimon_filter_idx as usize) - .map_or(false, |&name| name.to_str() == digimon.name) - }) { - let mut name_buffer = ImString::new(digimon.name.clone()); - if ui.input_text(imgui::im_str!("Name"), &mut name_buffer).resize_buffer(true).build() { - match ascii::AsciiString::from_ascii(name_buffer.to_string()) { - Ok(name) => { - digimon.name = name; - if let Some(name) = digimon_names.get_mut(idx) { - *name = name_buffer.clone(); - } - }, - Err(err) => { - ui.text(format!("Unable to set digimon name:\n{}", err.err_backtrace())); - }, - } - } - } - */ - } - - // Clear, render everything and flush it out - encoder.clear(&main_color, [0.2, 0.2, 0.2, 1.0]); - platform.prepare_render(&ui, windowed_context.window()); - renderer - .render(&mut factory, &mut encoder, &mut main_color, ui.render()) - .ignore_with_err(|err| log::warn!("Unable to render: {}", err.err_backtrace())); - encoder.flush(&mut device); - windowed_context - .swap_buffers() - .ignore_with_err(|err| log::warn!("Unable to swap buffers: {}", err.err_backtrace())); - device.cleanup(); - } - - // Convert everything back to yaml - let cards_table_yaml = serde_yaml::to_string(&cards_table).panic_err_msg("Unable to serialize cards table to yaml"); - let decks_table_yaml = serde_yaml::to_string(&decks_table).panic_err_msg("Unable to serialize decks table to yaml"); - - // Ouput all data to devices - std::fs::write(&data_dir.join("cards.yaml"), cards_table_yaml).panic_err_msg("Unable to write cards table to file"); - std::fs::write(&data_dir.join("decks.yaml"), decks_table_yaml).panic_err_msg("Unable to write decks table to file"); -}