diff --git a/src/rust/amadeus-rs/.gitignore b/src/rust/amadeus-rs/.gitignore index ea8c4bf7f35f6f77f75d92ad8ce8349f6e81ddba..fe9e67168199a05e1a330cf8e828cdf2b25b213b 100644 --- a/src/rust/amadeus-rs/.gitignore +++ b/src/rust/amadeus-rs/.gitignore @@ -1 +1,2 @@ /target +!*.lock diff --git a/src/rust/amadeus-rs/Cargo.lock b/src/rust/amadeus-rs/Cargo.lock new file mode 100644 index 0000000000000000000000000000000000000000..d765cb5ff7d370b29c38b88d702e3684ef8157b0 --- /dev/null +++ b/src/rust/amadeus-rs/Cargo.lock @@ -0,0 +1,2130 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ab_glyph" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04a9283dace1c41c265496614998d5b9c4a97b3eb770e804f007c5144bf03f2b" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "363b9b88fad3af3be80bc8f762c9a3f9dfe906fd0327b8e92f1c12e5ae1b8bbb" + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "serde", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57e6e951cfbb2db8de1828d49073a113a29fd7117b1596caa781a258c7e38d72" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "serde", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +dependencies = [ + "memchr", +] + +[[package]] +name = "amadeus" +version = "0.1.0" +dependencies = [ + "amadeus_macro", + "eframe", + "egui 0.19.0", + "epi", + "image", + "lazy_static", + "lkt_lib", + "log", + "serde", + "serde_json", +] + +[[package]] +name = "amadeus_macro" +version = "0.1.0" + +[[package]] +name = "arboard" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc120354d1b5ec6d7aaf4876b602def75595937b5e15d356eb554ab5177e08bb" +dependencies = [ + "clipboard-win", + "log", + "objc", + "objc-foundation", + "objc_id", + "parking_lot", + "thiserror", + "winapi", + "x11rb", +] + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "atomic_refcell" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b5e5f48b927f04e952dedc932f31995a65a0bf65ec971c74436e51bf6e970d" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "bumpalo" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" + +[[package]] +name = "bytemuck" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f5715e491b5a1598fc2bef5a606847b5dc1d48ea625bd3c02c00de8285591da" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9e1f5fa78f69496407a27ae9ed989e3c3b072310286f5ef385525e4cbc24a9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" + +[[package]] +name = "calloop" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22a6a8f622f797120d452c630b0ab12e1331a1a753e2039ce7868d4ac77b4ee" +dependencies = [ + "log", + "nix 0.24.2", + "slotmap", + "thiserror", + "vec_map", +] + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cgl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" +dependencies = [ + "libc", +] + +[[package]] +name = "clipboard-win" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4ab1b92798304eedc095b53942963240037c0516452cb11aeba709d420b2219" +dependencies = [ + "error-code", + "str-buf", + "winapi", +] + +[[package]] +name = "cmake" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +dependencies = [ + "cc", +] + +[[package]] +name = "cocoa" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" +dependencies = [ + "bitflags", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics", + "foreign-types 0.3.2", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +dependencies = [ + "bitflags", + "block", + "core-foundation", + "core-graphics-types", + "foreign-types 0.3.2", + "libc", + "objc", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "core-graphics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +dependencies = [ + "bitflags", + "core-foundation", + "core-graphics-types", + "foreign-types 0.3.2", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +dependencies = [ + "bitflags", + "core-foundation", + "foreign-types 0.3.2", + "libc", +] + +[[package]] +name = "core-text" +version = "19.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" +dependencies = [ + "core-foundation", + "core-graphics", + "foreign-types 0.3.2", + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossfont" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f66b1c1979c4362323f03ab6bf7fb522902bfc418e0c37319ab347f9561d980f" +dependencies = [ + "cocoa", + "core-foundation", + "core-foundation-sys", + "core-graphics", + "core-text", + "dwrote", + "foreign-types 0.5.0", + "freetype-rs", + "libc", + "log", + "objc", + "once_cell", + "pkg-config", + "servo-fontconfig", + "winapi", +] + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dlib" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" +dependencies = [ + "libloading", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "dwrote" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" +dependencies = [ + "lazy_static", + "libc", + "serde", + "serde_derive", + "winapi", + "wio", +] + +[[package]] +name = "eframe" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0d49426c3e72a6728b0c790d22db8bf7bbcff10d83b8b6f3a01295be982302e" +dependencies = [ + "bytemuck", + "directories-next", + "egui 0.19.0", + "egui-winit", + "egui_glow", + "getrandom", + "glow", + "glutin", + "js-sys", + "percent-encoding", + "ron 0.8.0", + "serde", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winit", +] + +[[package]] +name = "egui" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a3cd1d47e12f7a17912595241622e373aa652a4e0fa90b3f9278f90a64aedf7" +dependencies = [ + "ahash 0.7.6", + "epaint 0.17.0", + "nohash-hasher", + "ron 0.7.1", + "serde", +] + +[[package]] +name = "egui" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc9fcd393c3daaaf5909008a1d948319d538b79c51871e4df0993260260a94e4" +dependencies = [ + "ahash 0.8.0", + "epaint 0.19.0", + "nohash-hasher", + "ron 0.8.0", + "serde", + "tracing", +] + +[[package]] +name = "egui-winit" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ddc525334c416e11580123e147b970f738507f427c9fb1cd09ea2dd7416a3a" +dependencies = [ + "arboard", + "egui 0.19.0", + "instant", + "serde", + "smithay-clipboard", + "tracing", + "webbrowser", + "winit", +] + +[[package]] +name = "egui_glow" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad77d4a00402bae9658ee64be148f4b2a0b38e4fc7874970575ca01ed1c5b75d" +dependencies = [ + "bytemuck", + "egui 0.19.0", + "glow", + "memoffset", + "tracing", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "emath" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a977a80456be58a2c2d48e69c1d0baadef46cecef5a0c98df141c468da006f12" +dependencies = [ + "serde", +] + +[[package]] +name = "emath" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9542a40106fdba943a055f418d1746a050e1a903a049b030c2b097d4686a33cf" +dependencies = [ + "bytemuck", + "serde", +] + +[[package]] +name = "epaint" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "033292846059f08e03a71e1b5db2ee6ab7c9622c3b48da21f4bd13258ebee2db" +dependencies = [ + "ab_glyph", + "ahash 0.7.6", + "atomic_refcell", + "emath 0.17.0", + "nohash-hasher", + "serde", +] + +[[package]] +name = "epaint" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ba04741be7f6602b1a1b28f1082cce45948a7032961c52814f8946b28493300" +dependencies = [ + "ab_glyph", + "ahash 0.8.0", + "atomic_refcell", + "bytemuck", + "emath 0.19.0", + "nohash-hasher", + "parking_lot", + "serde", +] + +[[package]] +name = "epi" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c95445deccef4d29fa30488d3f7f2e942dd343eef01228becc7cefd5b918176e" +dependencies = [ + "egui 0.17.0", + "ron 0.7.1", + "serde", + "tracing", +] + +[[package]] +name = "error-code" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" +dependencies = [ + "libc", + "str-buf", +] + +[[package]] +name = "expat-sys" +version = "2.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658f19728920138342f68408b7cf7644d90d4784353d8ebc32e7e8663dbe45fa" +dependencies = [ + "cmake", + "pkg-config", +] + +[[package]] +name = "flate2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8469d0d40519bc608ec6863f1cc88f3f1deee15913f2f3b3e573d81ed38cccc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "freetype-rs" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74eadec9d0a5c28c54bb9882e54787275152a4e36ce206b45d7451384e5bf5fb" +dependencies = [ + "bitflags", + "freetype-sys", + "libc", +] + +[[package]] +name = "freetype-sys" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" +dependencies = [ + "cmake", + "libc", + "pkg-config", +] + +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "getrandom" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[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 = "glow" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glutin" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444c9ad294fdcaf20ccf6726b78f380b5450275540c9b68ab62f49726ad1c713" +dependencies = [ + "cgl", + "cocoa", + "core-foundation", + "glutin_egl_sys", + "glutin_gles2_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "libloading", + "log", + "objc", + "once_cell", + "osmesa-sys", + "parking_lot", + "raw-window-handle 0.5.0", + "wayland-client", + "wayland-egl", + "winapi", + "winit", +] + +[[package]] +name = "glutin_egl_sys" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68900f84b471f31ea1d1355567eb865a2cf446294f06cef8d653ed7bcf5f013d" +dependencies = [ + "gl_generator", + "winapi", +] + +[[package]] +name = "glutin_gles2_sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094e708b730a7c8a1954f4f8a31880af00eb8a1c5b5bf85d28a0a3c6d69103" +dependencies = [ + "gl_generator", + "objc", +] + +[[package]] +name = "glutin_glx_sys" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93d0575865098580c5b3a423188cd959419912ea60b1e48e8b3b526f6d02468" +dependencies = [ + "gl_generator", + "x11-dl", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3da5951a1569dbab865c6f2a863efafff193a93caf05538d193e9e3816d21696" +dependencies = [ + "gl_generator", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "image" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e30ca2ecf7666107ff827a8e481de6a132a9b687ed3bb20bb1c144a36c00964" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "jpeg-decoder", + "num-rational", + "num-traits", + "png", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "itoa" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" + +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jpeg-decoder" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9478aa10f73e7528198d75109c8be5cd7d15fb530238040148d5f9a22d4c5b3b" + +[[package]] +name = "js-sys" +version = "0.3.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" +dependencies = [ + "wasm-bindgen", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.132" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" + +[[package]] +name = "libloading" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "lkt-rs" +version = "0.1.0" +dependencies = [ + "amadeus_macro", + "lazy_static", + "lkt_lib", + "log", + "serde", + "serde_json", +] + +[[package]] +name = "lkt_lib" +version = "0.1.0" +dependencies = [ + "amadeus_macro", + "lazy_static", + "log", + "regex", + "serde", + "serde_json", +] + +[[package]] +name = "lock_api" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +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 = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memmap2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys", +] + +[[package]] +name = "ndk" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys 0.3.0", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys 0.4.0", + "num_enum", + "raw-window-handle 0.5.0", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-glue" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d0c4a7b83860226e6b4183edac21851f05d5a51756e97a1144b7f5a6b63e65f" +dependencies = [ + "lazy_static", + "libc", + "log", + "ndk 0.6.0", + "ndk-context", + "ndk-macro", + "ndk-sys 0.3.0", +] + +[[package]] +name = "ndk-glue" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0434fabdd2c15e0aab768ca31d5b7b333717f03cf02037d5a0a3ff3c278ed67f" +dependencies = [ + "libc", + "log", + "ndk 0.7.0", + "ndk-context", + "ndk-macro", + "ndk-sys 0.4.0", + "once_cell", + "parking_lot", +] + +[[package]] +name = "ndk-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" +dependencies = [ + "darling", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ndk-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "ndk-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21d83ec9c63ec5bf950200a8e508bdad6659972187b625469f58ef8c08e29046" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "nix" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" +dependencies = [ + "bitflags", + "cc", + "cfg-if", + "libc", + "memoffset", +] + +[[package]] +name = "nix" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" +dependencies = [ + "bitflags", + "cfg-if", + "libc", + "memoffset", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + +[[package]] +name = "once_cell" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" + +[[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 = "owned_ttf_parser" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e6affeb1632d6ff6a23d2cd40ffed138e82f1532571a26f527c8a284bb2fbb" +dependencies = [ + "ttf-parser", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pkg-config" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" + +[[package]] +name = "png" +version = "0.17.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f0e7f4c94ec26ff209cee506314212639d6c91b80afb82984819fafce9df01c" +dependencies = [ + "bitflags", + "crc32fast", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "proc-macro-crate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +dependencies = [ + "once_cell", + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro2" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "raw-window-handle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" +dependencies = [ + "cty", +] + +[[package]] +name = "raw-window-handle" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a" +dependencies = [ + "cty", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" + +[[package]] +name = "ron" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" +dependencies = [ + "base64", + "bitflags", + "serde", +] + +[[package]] +name = "ron" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300a51053b1cb55c80b7a9fde4120726ddf25ca241a1cbb926626f62fb136bff" +dependencies = [ + "base64", + "bitflags", + "serde", +] + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "safe_arch" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ff3d6d9696af502cc3110dacce942840fb06ff4514cad92236ecc455f2ce05" +dependencies = [ + "bytemuck", +] + +[[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 = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sctk-adwaita" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04b7c47a572f73de28bee5b5060d085b42b6ce1e4ee2b49c956ea7b25e94b6f0" +dependencies = [ + "crossfont", + "log", + "smithay-client-toolkit", + "tiny-skia", +] + +[[package]] +name = "serde" +version = "1.0.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "servo-fontconfig" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e3e22fe5fd73d04ebf0daa049d3efe3eae55369ce38ab16d07ddd9ac5c217c" +dependencies = [ + "libc", + "servo-fontconfig-sys", +] + +[[package]] +name = "servo-fontconfig-sys" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e36b879db9892dfa40f95da1c38a835d41634b825fbd8c4c418093d53c24b388" +dependencies = [ + "expat-sys", + "freetype-sys", + "pkg-config", +] + +[[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 = "slotmap" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" + +[[package]] +name = "smithay-client-toolkit" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f307c47d32d2715eb2e0ece5589057820e0e5e70d07c247d1063e844e107f454" +dependencies = [ + "bitflags", + "calloop", + "dlib", + "lazy_static", + "log", + "memmap2", + "nix 0.24.2", + "pkg-config", + "wayland-client", + "wayland-cursor", + "wayland-protocols", +] + +[[package]] +name = "smithay-clipboard" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a345c870a1fae0b1b779085e81b51e614767c239e93503588e54c5b17f4b0e8" +dependencies = [ + "smithay-client-toolkit", + "wayland-client", +] + +[[package]] +name = "str-buf" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" + +[[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.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1b05ca9d106ba7d2e31a9dab4a64e7be2cce415321966ea3132c49a656e252" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tiny-skia" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "642680569bb895b16e4b9d181c60be1ed136fa0c9c7f11d004daf053ba89bf82" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "png", + "safe_arch", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c114d32f0c2ee43d585367cb013dfaba967ab9f62b90d9af0d696e955e70fa6c" +dependencies = [ + "arrayref", + "bytemuck", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +dependencies = [ + "once_cell", +] + +[[package]] +name = "ttf-parser" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b3e06c9b9d80ed6b745c7159c40b311ad2916abb34a49e9be2653b90db0d8dd" + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" + +[[package]] +name = "unicode-normalization" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" + +[[package]] +name = "wayland-client" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f3b068c05a039c9f755f881dc50f01732214f5685e379829759088967c46715" +dependencies = [ + "bitflags", + "downcast-rs", + "libc", + "nix 0.24.2", + "scoped-tls", + "wayland-commons", + "wayland-scanner", + "wayland-sys", +] + +[[package]] +name = "wayland-commons" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8691f134d584a33a6606d9d717b95c4fa20065605f798a3f350d78dced02a902" +dependencies = [ + "nix 0.24.2", + "once_cell", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-cursor" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661" +dependencies = [ + "nix 0.24.2", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-egl" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "402de949f81a012926d821a2d659f930694257e76dd92b6e0042ceb27be4107d" +dependencies = [ + "wayland-client", + "wayland-sys", +] + +[[package]] +name = "wayland-protocols" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6" +dependencies = [ + "bitflags", + "wayland-client", + "wayland-commons", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f4303d8fa22ab852f789e75a967f0a2cdc430a607751c0499bada3e451cbd53" +dependencies = [ + "proc-macro2", + "quote", + "xml-rs", +] + +[[package]] +name = "wayland-sys" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be12ce1a3c39ec7dba25594b97b42cb3195d54953ddb9d3d95a7c3902bc6e9d4" +dependencies = [ + "dlib", + "lazy_static", + "pkg-config", +] + +[[package]] +name = "web-sys" +version = "0.3.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webbrowser" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a3cffdb686fbb24d9fb8f03a213803277ed2300f11026a3afe1f108dc021b" +dependencies = [ + "jni", + "ndk-glue 0.6.2", + "url", + "web-sys", + "widestring", + "winapi", +] + +[[package]] +name = "widestring" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +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-wsapoll" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" +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 = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "winit" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a8f3e9d742401efcfe833b8f84960397482ff049cb7bf59a112e14a4be97f7" +dependencies = [ + "bitflags", + "cocoa", + "core-foundation", + "core-graphics", + "dispatch", + "instant", + "libc", + "log", + "mio", + "ndk 0.7.0", + "ndk-glue 0.7.0", + "objc", + "once_cell", + "parking_lot", + "percent-encoding", + "raw-window-handle 0.4.3", + "raw-window-handle 0.5.0", + "sctk-adwaita", + "smithay-client-toolkit", + "wasm-bindgen", + "wayland-client", + "wayland-protocols", + "web-sys", + "windows-sys", + "x11-dl", +] + +[[package]] +name = "wio" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" +dependencies = [ + "winapi", +] + +[[package]] +name = "x11-dl" +version = "2.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c83627bc137605acc00bb399c7b908ef460b621fc37c953db2b09f88c449ea6" +dependencies = [ + "lazy_static", + "libc", + "pkg-config", +] + +[[package]] +name = "x11rb" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e99be55648b3ae2a52342f9a870c0e138709a3493261ce9b469afe6e4df6d8a" +dependencies = [ + "gethostname", + "nix 0.22.3", + "winapi", + "winapi-wsapoll", +] + +[[package]] +name = "xcursor" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" +dependencies = [ + "nom", +] + +[[package]] +name = "xml-rs" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" diff --git a/src/rust/amadeus-rs/amadeus/src/action/action.rs b/src/rust/amadeus-rs/amadeus/src/action/actions.rs similarity index 99% rename from src/rust/amadeus-rs/amadeus/src/action/action.rs rename to src/rust/amadeus-rs/amadeus/src/action/actions.rs index 2b9931314cc398672b9e53815dbf47e132a2909e..50ab7330a52f8d24accf4ae5416d8645c1dd4ff5 100644 --- a/src/rust/amadeus-rs/amadeus/src/action/action.rs +++ b/src/rust/amadeus-rs/amadeus/src/action/actions.rs @@ -74,7 +74,7 @@ impl fmt::Debug for Action { pub fn get_card_action_name(act: &Action) -> &'static str { use Action::*; - return match act { + match act { PlayFromKara => "Play from that kara", DeleteKaraFromQueue => "Delete from the queue", @@ -95,5 +95,5 @@ pub fn get_card_action_name(act: &Action) -> &'static str { PlaybackPlay => "Play", PlaybackPause => "Pause", PlaybackNext => "Next", - }; + } } diff --git a/src/rust/amadeus-rs/amadeus/src/action/menu.rs b/src/rust/amadeus-rs/amadeus/src/action/menu.rs index 828d4057e836ff20ee2420af295fb63112afddbb..04bfac65b6e00968e2e8d3ae450fb1067221e32f 100644 --- a/src/rust/amadeus-rs/amadeus/src/action/menu.rs +++ b/src/rust/amadeus-rs/amadeus/src/action/menu.rs @@ -1,10 +1,9 @@ -use super::action::get_card_action_name; -use super::Action; +use super::{actions::get_card_action_name, Action}; use crate::utils; pub fn render_action_menu( ui: &mut egui::Ui, - actions: &Vec<Action>, + actions: &[Action], menu_name: impl Into<egui::WidgetText>, fullfilled: &mut Vec<Action>, ) { diff --git a/src/rust/amadeus-rs/amadeus/src/action/mod.rs b/src/rust/amadeus-rs/amadeus/src/action/mod.rs index c24c5a8375a960113676566586e00b3f8d05dc3e..60e0752e92e53544b7f1654b67a027dd25987fb3 100644 --- a/src/rust/amadeus-rs/amadeus/src/action/mod.rs +++ b/src/rust/amadeus-rs/amadeus/src/action/mod.rs @@ -1,5 +1,5 @@ -mod action; +mod actions; mod menu; -pub use action::*; +pub use actions::*; pub use menu::render_action_menu; diff --git a/src/rust/amadeus-rs/amadeus/src/amadeus.rs b/src/rust/amadeus-rs/amadeus/src/amadeus.rs index a7c1abcc6ea5f819951efb2488b871b64874e197..a9af04b6b5182903cdc462a59ad5f3f855a33a22 100644 --- a/src/rust/amadeus-rs/amadeus/src/amadeus.rs +++ b/src/rust/amadeus-rs/amadeus/src/amadeus.rs @@ -1,7 +1,3 @@ -// https://docs.rs/epi/0.17.0/epi/trait.App.html -// https://docs.rs/egui/0.17.0/egui/ -// https://docs.rs/egui/0.17.0/egui/struct.FontDefinitions.html - use crate::{ action, cards::*, @@ -22,6 +18,16 @@ use std::{ time, }; +type CommandDeamonData = ( + (Sender<LektorQuery>, Receiver<LektorFormatedResponse>), + utils::deamon::CommandDeamon, +); + +type StatusDeamonData = ( + (Receiver<utils::deamon::StatusDeamonMessageType>,), + utils::deamon::StatusDeamon, +); + pub struct Amadeus<'a> { config: utils::AmadeusConfig, has_config_changed: bool, @@ -32,14 +38,8 @@ pub struct Amadeus<'a> { last_render_instant: time::SystemTime, begin_render_instant: time::SystemTime, - deamon: Option<( - (Sender<LektorQuery>, Receiver<LektorFormatedResponse>), - utils::deamon::CommandDeamon, - )>, - status_deamon: Option<( - (Receiver<utils::deamon::StatusDeamonMessageType>,), - utils::deamon::StatusDeamon, - )>, + deamon: Option<CommandDeamonData>, + status_deamon: Option<StatusDeamonData>, lektord_current_kara: Option<KaraCard>, lektord_queue: KaraCardCollection<'a>, @@ -131,7 +131,7 @@ impl Amadeus<'_> { ret.extend(self.lektord_historic.fulfilled_actions()); ret.extend(self.lektord_search_results.fulfilled_actions()); ret.extend(self.playlist_store.fulfilled_actions()); - return ret; + ret } fn render_side_panel_main_view_button( @@ -204,7 +204,7 @@ impl Amadeus<'_> { .unwrap() .as_secs() % 90; - let progress = seconds as f32 / 90 as f32; + let progress = seconds as f32 / 90_f32; let text_duration = { let duration = time::Duration::from_secs(seconds); let mins = duration.as_secs() / 60; @@ -356,7 +356,7 @@ impl Amadeus<'_> { for act in self.actions.drain(..) { match act { ConnectToLektord => { - if !self.status_deamon.is_some() { + if self.status_deamon.is_none() { let connexion = utils::deamon::StatusDeamon::spawn( self.config.lektord_hostname.clone(), self.config.lektord_port.as_integer() as i16, @@ -365,7 +365,7 @@ impl Amadeus<'_> { self.status_deamon = Some(connexion); } } - if !self.deamon.is_some() { + if self.deamon.is_none() { let connexion = utils::deamon::CommandDeamon::spawn( self.config.lektord_hostname.clone(), self.config.lektord_port.as_integer() as i16, @@ -479,7 +479,7 @@ impl App for Amadeus<'_> { &mut self.need_about_window, self.config.dark_mode, ctx, - &self.amadeus_logo_texture.as_ref().unwrap(), + self.amadeus_logo_texture.as_ref().unwrap(), ); self.config.render_settings_window( ctx, diff --git a/src/rust/amadeus-rs/amadeus/src/cards/card.rs b/src/rust/amadeus-rs/amadeus/src/cards/card.rs index 5d3a9027c15437e8dd5f0eb33dbe11820127486f..1bfa027c8454f1f0842f0df923e396219b47a1b1 100644 --- a/src/rust/amadeus-rs/amadeus/src/cards/card.rs +++ b/src/rust/amadeus-rs/amadeus/src/cards/card.rs @@ -8,11 +8,11 @@ pub trait Card<'a, LktType: LektorType<'a>>: ToString + Clone { fn new(lkt_type: LktType) -> Self; /// Render the card to the screen - fn render(self: &mut Self, ui: &mut egui::Ui, dark_mode: bool, actions: &Vec<action::Action>); + fn render(&mut self, ui: &mut egui::Ui, dark_mode: bool, actions: &[action::Action]); /// Render the card to the screen. Variant to try to render the element in a /// more compact way. - fn render_compact(self: &Self, ui: &mut egui::Ui, dark_mode: bool); + fn render_compact(&self, ui: &mut egui::Ui, dark_mode: bool); /// Returns the Ids of the activated actions. fn fulfilled_actions(&mut self) -> Vec<action::Action>; @@ -79,7 +79,7 @@ impl Card<'_, Kara> for KaraCard { Self { inner, actions } } - fn render(&mut self, ui: &mut egui::Ui, dark_mode: bool, actions: &Vec<action::Action>) { + fn render(&mut self, ui: &mut egui::Ui, dark_mode: bool, actions: &[action::Action]) { ui.add_space(constants::PADDING); static MIN_WIDTH_FOR_ADDITIONAL_INFOS: f32 = 1024.; let song = format!( @@ -130,7 +130,7 @@ impl Card<'_, Kara> for KaraCard { ui.add_space(constants::PADDING); } - fn render_compact(self: &Self, ui: &mut egui::Ui, dark_mode: bool) { + fn render_compact(&self, ui: &mut egui::Ui, dark_mode: bool) { let header = format!( "{} - {} by {}", self.inner.category, self.inner.language, self.inner.author @@ -169,11 +169,11 @@ impl Card<'_, Kara> for KaraCard { fn fulfilled_actions(&mut self) -> Vec<action::Action> { let ret = self.actions.clone(); self.actions.clear(); - return ret; + ret } fn unique_id(&self) -> u64 { - return self.inner.unique_id(); + self.inner.unique_id() } } @@ -188,25 +188,25 @@ impl Card<'_, Playlist> for PlaylistCard { Self { inner, actions } } - fn render(&mut self, ui: &mut egui::Ui, dark_mode: bool, actions: &Vec<action::Action>) { + fn render(&mut self, ui: &mut egui::Ui, dark_mode: bool, actions: &[action::Action]) { ui.horizontal(|ui| { ui.add_space(constants::PADDING * 2.); ui.style_mut().override_text_style = Some(utils::font::body()); action::render_action_menu(ui, actions, "â–¶", &mut self.actions); ui.colored_label( constants::get_text_color(dark_mode), - format!("{}", self.inner.name), + self.inner.name.to_string(), ); ui.label(format!(" #{}", self.inner.id)); }); ui.add_space(constants::PADDING); } - fn render_compact(self: &Self, ui: &mut egui::Ui, dark_mode: bool) { + fn render_compact(&self, ui: &mut egui::Ui, dark_mode: bool) { ui.horizontal(|ui| { ui.colored_label( constants::get_text_color(dark_mode), - format!("{}", self.inner.name), + self.inner.name.to_string(), ); ui.label(format!(" #{}", self.inner.id)); }); @@ -215,10 +215,10 @@ impl Card<'_, Playlist> for PlaylistCard { fn fulfilled_actions(&mut self) -> Vec<action::Action> { let ret = self.actions.clone(); self.actions.clear(); - return ret; + ret } fn unique_id(&self) -> u64 { - return self.inner.unique_id(); + self.inner.unique_id() } } diff --git a/src/rust/amadeus-rs/amadeus/src/cards/collection.rs b/src/rust/amadeus-rs/amadeus/src/cards/collection.rs index 228bc9260db86b1b0893c572fa64d7e484ead129..4cd507bdf5c88c1e18925d9ad291aaa68d66a9c9 100644 --- a/src/rust/amadeus-rs/amadeus/src/cards/collection.rs +++ b/src/rust/amadeus-rs/amadeus/src/cards/collection.rs @@ -48,21 +48,21 @@ impl<'a, CardType: Card<'a, LktType>, LktType: LektorType<'a>> pub fn with_max_content(&mut self, max_content: usize) -> &mut Self { self.max_content = either!(max_content != 0 => Some(max_content); None); - return self; + self } pub fn add_card(&mut self, card: CardType) -> &mut Self { self.content.push(card); - return self; + self } pub fn add_action(mut self, act: action::Action) -> Self { self.actions.push(act); - return self; + self } - pub fn empty(self: &Self) -> bool { - return self.content.len() == 0; + pub fn empty(&self) -> bool { + self.content.is_empty() } pub fn fulfilled_actions(&mut self) -> Vec<(u64, action::Action)> { @@ -78,18 +78,15 @@ impl<'a, CardType: Card<'a, LktType>, LktType: LektorType<'a>> } } } - return ret; + ret } - pub fn render(self: &mut Self, ui: &mut egui::Ui, dark_mode: bool) { + pub fn render(&mut self, ui: &mut egui::Ui, dark_mode: bool) { ui.vertical(|ui| { ui.add_space(constants::PADDING); ui.horizontal(|ui| { ui.style_mut().override_text_style = Some(utils::font::heading1()); - ui.colored_label( - constants::get_text_color(dark_mode), - format!("{}", self.name), - ); + ui.colored_label(constants::get_text_color(dark_mode), self.name.to_string()); ui.style_mut().override_text_style = Some(utils::font::small_body()); ui.label(format!(" ({} elements)", self.content.len())); }); diff --git a/src/rust/amadeus-rs/amadeus/src/constants.rs b/src/rust/amadeus-rs/amadeus/src/constants.rs index 9580093768b1372303b43f9dcb5f0332b2099899..41a90eefb0d5579509bb7a4f90438d81e41bf129 100644 --- a/src/rust/amadeus-rs/amadeus/src/constants.rs +++ b/src/rust/amadeus-rs/amadeus/src/constants.rs @@ -12,30 +12,30 @@ const RED: Color32 = Color32::from_rgb(255, 0, 0); pub fn get_fill_color(dark_mode: bool) -> Color32 { let base_color = get_accent_color(dark_mode); if dark_mode { - return base_color; + base_color } else { - let factor = 0.69 as f32; - return Color32::from_rgb( + let factor = 0.69_f32; + Color32::from_rgb( (base_color.r() as f32 * factor) as u8, (base_color.g() as f32 * factor) as u8, (base_color.b() as f32 * factor) as u8, - ); + ) } } pub fn get_text_color(dark_mode: bool) -> Color32 { - return either!(dark_mode => WHITE; BLACK); + either!(dark_mode => WHITE; BLACK) } pub fn get_accent_color(dark_mode: bool) -> Color32 { - return either!(dark_mode => get_darker_color(CYAN); RED); + either!(dark_mode => get_darker_color(CYAN); RED) } fn get_darker_color(color: Color32) -> Color32 { - let factor = 0.69 as f32; - return Color32::from_rgb( + let factor = 0.69_f32; + Color32::from_rgb( (color.r() as f32 * factor) as u8, (color.g() as f32 * factor) as u8, (color.b() as f32 * factor) as u8, - ); + ) } diff --git a/src/rust/amadeus-rs/amadeus/src/playlists.rs b/src/rust/amadeus-rs/amadeus/src/playlists.rs index 2fdf70f2541a90b74ae706a0e77b498c7d2263e0..b4a642567a17dd74f5a4606db85207de94bf17fc 100644 --- a/src/rust/amadeus-rs/amadeus/src/playlists.rs +++ b/src/rust/amadeus-rs/amadeus/src/playlists.rs @@ -39,12 +39,12 @@ impl Default for PlaylistsStore { impl PlaylistsStore { pub fn fulfilled_actions(&mut self) -> Vec<(u64, action::Action)> { - if self.actions.len() != 0 { + if !self.actions.is_empty() { let ret = self.actions.clone(); self.actions.clear(); - return ret; + ret } else { - return vec![]; + vec![] } } @@ -80,7 +80,7 @@ impl PlaylistsStore { .always_show_scroll(false) .max_width(f32::INFINITY) .show(ui, |ui| { - if karas.len() == 0 { + if karas.is_empty() { ui.horizontal(|ui| { ui.label("Empty playlist"); ui.add_space(constants::PADDING); @@ -93,7 +93,7 @@ impl PlaylistsStore { Some(utils::font::body()); action::render_action_menu( ui, - &vec![ + &[ action::Action::AddKaraToQueue, action::Action::InsertKaraInQueue, action::Action::AddKaraToPlaylist, @@ -151,7 +151,7 @@ impl PlaylistsStore { ui.add_space(constants::PADDING); action::render_action_menu( ui, - &vec![ + &[ action::Action::OpenPlaylist, action::Action::AddPlaylistToQueue, action::Action::InsertPlaylistToQueue, @@ -181,7 +181,7 @@ impl PlaylistsStore { .playlists .iter() .filter(|(plt_name, _)| *plt_name == name) - .map(|(name, id)| (name.as_str(), id.clone())) + .map(|(name, id)| (name.as_str(), *id)) .next(); } @@ -220,6 +220,6 @@ impl PlaylistsStore { pub fn playlist_size(&self, name: &str) -> Option<usize> { let (_, id) = self.get_playlist_by_name(name)?; let content = self.contents.get(&id)?; - return Some(content.len()); + Some(content.len()) } } diff --git a/src/rust/amadeus-rs/amadeus/src/utils/config.rs b/src/rust/amadeus-rs/amadeus/src/utils/config.rs index 75e8e9e957388242e40406da9e0261430e92a1cb..6f8189dd1760d03e73ee714b7515f465a4552fd7 100644 --- a/src/rust/amadeus-rs/amadeus/src/utils/config.rs +++ b/src/rust/amadeus-rs/amadeus/src/utils/config.rs @@ -2,7 +2,7 @@ use crate::widgets; /// Indicate which view should be displayed in the central panel of Amadeus' /// main window. -#[derive(serde::Serialize, serde::Deserialize, PartialEq)] +#[derive(serde::Serialize, serde::Deserialize, PartialEq, Eq)] pub enum AmadeusMainView { /// The main panel should show the queue of lektord, i.e. the kara that will /// be played. diff --git a/src/rust/amadeus-rs/amadeus/src/utils/deamon.rs b/src/rust/amadeus-rs/amadeus/src/utils/deamon.rs index 2cc99ad39eaf7ca76c2dafe3a7043263f0670e3c..1cf061e2ded944e8a290086d8217e39bc3ddbdfa 100644 --- a/src/rust/amadeus-rs/amadeus/src/utils/deamon.rs +++ b/src/rust/amadeus-rs/amadeus/src/utils/deamon.rs @@ -20,7 +20,6 @@ pub trait Deamon: Sized { fn quit(&self); /// Spawn a deamon - #[must_use] fn spawn(hostname: String, port: i16) -> io::Result<(Self::Channels, Self)>; /// Returns true when the thread has terminated. @@ -123,14 +122,12 @@ impl Deamon for CommandDeamon { }; }); - return Ok(( - (commands_send, responses_recv), - Self { - thread: Arc::new(Mutex::new(Cell::new(Some(thread)))), - quit, - joined, - }, - )); + let ret = Self { + thread: Arc::new(Mutex::new(Cell::new(Some(thread)))), + quit, + joined, + }; + Ok(((commands_send, responses_recv), ret)) } } @@ -190,13 +187,11 @@ impl Deamon for StatusDeamon { } }); - return Ok(( - (responses_recv,), - Self { - thread: Arc::new(Mutex::new(Cell::new(Some(thread)))), - quit, - joined, - }, - )); + let ret = Self { + thread: Arc::new(Mutex::new(Cell::new(Some(thread)))), + quit, + joined, + }; + Ok(((responses_recv,), ret)) } } diff --git a/src/rust/amadeus-rs/amadeus/src/utils/font.rs b/src/rust/amadeus-rs/amadeus/src/utils/font.rs index c14df9f72b464fc057a75ac7bcdff7ddbac7ff8f..c75eeebf28ad1f83e08dc6d04ea95467704ae80b 100644 --- a/src/rust/amadeus-rs/amadeus/src/utils/font.rs +++ b/src/rust/amadeus-rs/amadeus/src/utils/font.rs @@ -82,7 +82,7 @@ pub fn get_font_definitions() -> FontDefinitions { .unwrap() .push(CJK_NAME.to_owned()); - return fonts; + fonts } pub fn get_font_styles() -> BTreeMap<TextStyle, FontId> { @@ -96,5 +96,5 @@ pub fn get_font_styles() -> BTreeMap<TextStyle, FontId> { (button(), FontId::new(14.0, Proportional)), (small(), FontId::new(10.0, Proportional)), ]; - return styles.into(); + styles.into() } diff --git a/src/rust/amadeus-rs/amadeus/src/utils/int_text_buffer.rs b/src/rust/amadeus-rs/amadeus/src/utils/int_text_buffer.rs index 7bcdc8a356d31e5e400339618ab113e4217d9fba..c53348eaed65002162508b2d128050c95bb1fbee 100644 --- a/src/rust/amadeus-rs/amadeus/src/utils/int_text_buffer.rs +++ b/src/rust/amadeus-rs/amadeus/src/utils/int_text_buffer.rs @@ -13,18 +13,18 @@ impl<T: private::Unsigned + private::Zero<T>> IntegerTextBuffer<T> { where <T as FromStr>::Err: std::fmt::Display, { - return if self.buffer.len() == 0 { + if self.buffer.is_empty() { T::ZERO } else { match self.buffer.parse::<T>() { Ok(int) => int, Err(e) => panic!("Failed to parse integer: {}", e), } - }; + } } fn remove_all_non_digit_chars(&mut self) { - self.buffer = self.buffer.chars().filter(|c| c.is_digit(10)).collect(); + self.buffer = self.buffer.chars().filter(|c| c.is_ascii_digit()).collect(); } } @@ -45,7 +45,7 @@ impl<T: private::Unsigned + private::Zero<T>> From<&str> for IntegerTextBuffer<T impl<T: private::Unsigned + private::Zero<T>> AsRef<str> for IntegerTextBuffer<T> { fn as_ref(&self) -> &str { - return self.buffer.as_str(); + self.buffer.as_str() } } @@ -68,7 +68,7 @@ impl<T: private::Unsigned + private::Zero<T>> TextBuffer for IntegerTextBuffer<T fn insert_text(&mut self, text: &str, char_index: usize) -> usize { let ret = self.buffer.insert_text(text, char_index); self.remove_all_non_digit_chars(); - return ret; + ret } fn delete_char_range(&mut self, char_range: std::ops::Range<usize>) { @@ -87,7 +87,7 @@ impl<T: private::Unsigned + private::Zero<T>> TextBuffer for IntegerTextBuffer<T fn take(&mut self) -> String { let s = self.as_ref().to_owned(); self.clear(); - return s; + s } } diff --git a/src/rust/amadeus-rs/amadeus/src/utils/mod.rs b/src/rust/amadeus-rs/amadeus/src/utils/mod.rs index babd0e72d59234e083392acc5b8a71e16a135da1..9fb004f44a8a2fefecd2df67e436012d34c04d80 100644 --- a/src/rust/amadeus-rs/amadeus/src/utils/mod.rs +++ b/src/rust/amadeus-rs/amadeus/src/utils/mod.rs @@ -16,14 +16,14 @@ pub(crate) fn get_icon_as_dynamic_image() -> (image::RgbaImage, [u32; 2]) { .thumbnail(LOGO_SIDE, LOGO_SIDE); let size = [logo_data.width(), logo_data.height()]; let logo_buffer = logo_data.to_rgba8(); - return (logo_buffer, size); + (logo_buffer, size) } pub(crate) fn get_icon_data() -> eframe::IconData { let (logo_buffer, [size_x, size_y]) = get_icon_as_dynamic_image(); - return eframe::IconData { + eframe::IconData { rgba: logo_buffer.to_vec(), height: size_y, width: size_x, - }; + } } diff --git a/src/rust/amadeus-rs/amadeus/src/widgets/progress_bar.rs b/src/rust/amadeus-rs/amadeus/src/widgets/progress_bar.rs index f4df388394148de7f1a4ff878bc3c20b59ebf4ff..a5a266d918fc9e5a27e22cb0b513a76397c60092 100644 --- a/src/rust/amadeus-rs/amadeus/src/widgets/progress_bar.rs +++ b/src/rust/amadeus-rs/amadeus/src/widgets/progress_bar.rs @@ -1,5 +1,5 @@ pub fn progress_bar(dark_mode: bool, progress: f32) -> impl egui::Widget + 'static { - return move |ui: &mut egui::Ui| { + move |ui: &mut egui::Ui| { let progress = progress.clamp(0.0, 1.0); let fill_color = crate::constants::get_fill_color(dark_mode); let desired_width = egui::NumExt::at_least(ui.available_size_before_wrap().x, 96.0); @@ -19,6 +19,6 @@ pub fn progress_bar(dark_mode: bool, progress: f32) -> impl egui::Widget + 'stat .rect(rect, 0.0, fill_color, egui::Stroke::none()); } - return response; - }; + response + } } diff --git a/src/rust/amadeus-rs/amadeus/src/widgets/toggle_switch.rs b/src/rust/amadeus-rs/amadeus/src/widgets/toggle_switch.rs index 7a16d52b77e3136b26a76db0886904a1e7cf197a..16d5b93ade1a9106d34ab5416b78a6af80ccb5b3 100644 --- a/src/rust/amadeus-rs/amadeus/src/widgets/toggle_switch.rs +++ b/src/rust/amadeus-rs/amadeus/src/widgets/toggle_switch.rs @@ -2,7 +2,7 @@ use crate::constants; use amadeus_macro::either; pub fn toggle_switch(dark_mode: bool, on: &mut bool) -> impl egui::Widget + '_ { - return move |ui: &mut egui::Ui| { + move |ui: &mut egui::Ui| { let desired_size = ui.spacing().interact_size.y * egui::vec2(2.0, 1.0); let (rect, mut response) = ui.allocate_exact_size(desired_size, egui::Sense::click()); if response.clicked() { @@ -39,6 +39,6 @@ pub fn toggle_switch(dark_mode: bool, on: &mut bool) -> impl egui::Widget + '_ { .circle(center, 0.75 * radius, fill_fore, fg_stroke); } - return response; - }; + response + } } diff --git a/src/rust/amadeus-rs/amadeus/src/widgets/window.rs b/src/rust/amadeus-rs/amadeus/src/widgets/window.rs index c11e0b2329deb0d394d3aecf79aabb717eb01305..3cbafbb5d163771810afcf749000402636f99947 100644 --- a/src/rust/amadeus-rs/amadeus/src/widgets/window.rs +++ b/src/rust/amadeus-rs/amadeus/src/widgets/window.rs @@ -2,6 +2,7 @@ use crate::{ action::{self, Action}, constants, }; +use amadeus_macro::*; /// Structure used to hole informations about the window to create, we use a /// builder pattern here. @@ -81,22 +82,16 @@ impl<'a> WindowBuilder<'a> { // Force the mut borrow of the flag to be dropped { - let win = egui::Window::new(self.name.clone()) - .open(flag) - .title_bar(false); + let win = egui::Window::new(self.name).open(flag).title_bar(false); let (win, resizable) = match self.resizable { Some(resizable) => (win.resizable(resizable), resizable), None => (win, false), }; let win = match self.default_size { + None => win, Some(sizes) => { - if resizable { - win.default_size(sizes).fixed_size(sizes) - } else { - win.default_size(sizes) - } + either!(resizable => win.default_size(sizes).fixed_size(sizes); win.default_size(sizes)) } - None => win, }; win.show(ctx, |ui| { ui.horizontal(|ui| { diff --git a/src/rust/amadeus-rs/lkt-lib/src/connexion.rs b/src/rust/amadeus-rs/lkt-lib/src/connexion.rs index 2b63c4cc77b4dbbf650e8948e2a2b8c9c1ff0fbe..70a3bcf0185c4202d0da22be928f56da6a5db3fd 100644 --- a/src/rust/amadeus-rs/lkt-lib/src/connexion.rs +++ b/src/rust/amadeus-rs/lkt-lib/src/connexion.rs @@ -1,10 +1,9 @@ -use log::error; - use crate::{constants, query::LektorQuery, query::LektorQueryLineType}; +use log::error; use std::{ - fmt, io::{self, BufRead, BufReader, Write}, net::TcpStream, + str::FromStr, }; pub struct LektorConnexion { @@ -14,8 +13,8 @@ pub struct LektorConnexion { reader: BufReader<TcpStream>, } -impl fmt::Debug for LektorConnexion { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { +impl std::fmt::Debug for LektorConnexion { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("LektorConnexion") .field("stream", &self.stream) .field("version", &self.version) @@ -43,11 +42,11 @@ impl LektorConnexion { ret.version, daemon_version ); - return Ok(ret); + Ok(ret) } Err(e) => { error!("Failed to connect to lektor: {e}"); - return Err(e); + Err(e) } } } @@ -55,7 +54,7 @@ impl LektorConnexion { pub fn send_query(&mut self, query: LektorQuery) -> io::Result<Vec<String>> { let mut res: Vec<String> = Vec::new(); self.send_query_inner(query, &mut res)?; - return Ok(res); + Ok(res) } fn send_query_inner( @@ -63,7 +62,7 @@ impl LektorConnexion { query: LektorQuery, previous_ret: &mut Vec<String>, ) -> io::Result<()> { - self.write_string(query.clone().to_string())?; + self.write_string(query.to_string())?; loop { match self.read_replies() { Ok((res, None)) => { @@ -90,22 +89,30 @@ impl LektorConnexion { match self.reader.read_line(&mut reply_line) { Err(e) => return io::Result::Err(e), Ok(size) => { - if size <= 0 { + if size == 0 { panic!("Got nothing in the line... consider this to be an error") } let msg = reply_line.trim(); - match LektorQueryLineType::from_str(&msg) { - LektorQueryLineType::Ok => return Ok((ret, None)), - LektorQueryLineType::Ack => return error_return_value, - LektorQueryLineType::Data => ret.push(msg.to_string()), - LektorQueryLineType::Continuation(cont) => return Ok((ret, Some(cont))), + match LektorQueryLineType::from_str(msg) { + Ok(LektorQueryLineType::Ok) => return Ok((ret, None)), + Ok(LektorQueryLineType::Ack) => return error_return_value, + Ok(LektorQueryLineType::Data) => ret.push(msg.to_string()), + Ok(LektorQueryLineType::Continuation(cont)) => { + return Ok((ret, Some(cont))) + } + Err(_) => { + return Err(io::Error::new( + io::ErrorKind::Other, + "unknown query line type", + )) + } } } } } } - fn write_string(self: &mut Self, buffer: String) -> io::Result<()> { + fn write_string(&mut self, buffer: String) -> io::Result<()> { if buffer.len() >= constants::LKT_MESSAGE_MAX { panic!( "Try to write a string that is too long for MPD! String length is {}, max is {}", @@ -113,7 +120,7 @@ impl LektorConnexion { constants::LKT_MESSAGE_MAX ); } - if buffer.chars().last() != Some('\n') { + if !buffer.ends_with('\n') { panic!( "A line to be send must end with a newline (\\n), it was not the case for: {}", buffer diff --git a/src/rust/amadeus-rs/lkt-lib/src/query.rs b/src/rust/amadeus-rs/lkt-lib/src/query.rs index ecc9278889c086501ab959d22565bad8169e0e0a..aba241678e08c104f2f73444983937473ba4a08c 100644 --- a/src/rust/amadeus-rs/lkt-lib/src/query.rs +++ b/src/rust/amadeus-rs/lkt-lib/src/query.rs @@ -33,19 +33,23 @@ pub enum LektorQuery { Continuation(usize, Box<LektorQuery>), } -impl LektorQueryLineType { - pub fn from_str(line: &str) -> Self { - if Self::is_line_ok(&line) { - return Self::Ok; - } else if Self::is_line_ack(&line) { - return Self::Ack; - } else if let Some(cont) = Self::is_line_continuation(&line) { - return Self::Continuation(cont); +impl std::str::FromStr for LektorQueryLineType { + type Err = (); + + fn from_str(line: &str) -> Result<Self, Self::Err> { + if Self::is_line_ok(line) { + Ok(Self::Ok) + } else if Self::is_line_ack(line) { + Ok(Self::Ack) + } else if let Some(cont) = Self::is_line_continuation(line) { + Ok(Self::Continuation(cont)) } else { - return Self::Data; + Ok(Self::Data) } } +} +impl LektorQueryLineType { fn is_line_continuation(line: &str) -> Option<usize> { if line.starts_with("continue:") { match line.trim_start_matches("continue:").trim().parse::<usize>() { @@ -58,11 +62,11 @@ impl LektorQueryLineType { } fn is_line_ok(line: &str) -> bool { - return (line == "OK\n") || (line == "OK"); + (line == "OK\n") || (line == "OK") } fn is_line_ack(line: &str) -> bool { - return line.starts_with("ACK: "); + line.starts_with("ACK: ") } } diff --git a/src/rust/amadeus-rs/lkt-lib/src/response.rs b/src/rust/amadeus-rs/lkt-lib/src/response.rs index fd4c97e3bafa46ab5a55dec0fdc6c7e5b43e8823..24333136643937dc576f67c27cb2fcac7ba55db7 100644 --- a/src/rust/amadeus-rs/lkt-lib/src/response.rs +++ b/src/rust/amadeus-rs/lkt-lib/src/response.rs @@ -23,10 +23,7 @@ impl From<Vec<String>> for LektorFormatedResponse { .map(|line| { let key_pair: Vec<&str> = line.splitn(2, ':').collect(); if let [key, value] = key_pair[..] { - ( - key.trim().to_lowercase().to_owned(), - value.trim().to_owned(), - ) + (key.trim().to_lowercase(), value.trim().to_owned()) } else { panic!("Invalid line for formated response: {}", line); } @@ -61,10 +58,7 @@ pub struct PlaybackStatus { impl PlaybackStatus { pub fn consume(response: &mut LektorFormatedResponse) -> Self { let mut ret = Self { - elapsed: match response.pop("elapsed").parse::<usize>() { - Ok(x) => x, - Err(_) => 0, - }, + elapsed: response.pop("elapsed").parse::<usize>().unwrap_or(0), songid: match response.pop("songid").parse::<isize>() { Ok(x) if x <= 0 => None, Ok(x) => Some(x as usize), @@ -93,7 +87,7 @@ impl PlaybackStatus { "pause" => LektorState::Pause(ret.songid.unwrap()), _ => LektorState::Stopped, }; - return ret; + ret } } diff --git a/src/rust/amadeus-rs/lkt-lib/src/types.rs b/src/rust/amadeus-rs/lkt-lib/src/types.rs index 2ac21fcfe4b917a618133b8180cad982292ebd7f..fa3faaff91f5cbad22c1cd8d0a5a38fed70c46f7 100644 --- a/src/rust/amadeus-rs/lkt-lib/src/types.rs +++ b/src/rust/amadeus-rs/lkt-lib/src/types.rs @@ -8,7 +8,7 @@ pub trait LektorType<'a>: fn unique_id(&self) -> u64; } -#[derive(Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +#[derive(Clone, Eq, serde::Serialize, serde::Deserialize)] pub struct Kara { pub id: u32, pub source_name: String, @@ -24,21 +24,33 @@ pub struct Kara { pub is_available: bool, } -#[derive(Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +#[derive(Clone, Eq, serde::Serialize, serde::Deserialize)] pub struct Playlist { pub id: u32, pub name: String, } +impl PartialEq for Kara { + fn eq(&self, other: &Self) -> bool { + self.id == other.id + } +} + +impl PartialEq for Playlist { + fn eq(&self, other: &Self) -> bool { + self.id == other.id + } +} + impl LektorType<'_> for Kara { fn unique_id(&self) -> u64 { - return private::unique_id(self); + private::unique_id(self) } } impl LektorType<'_> for Playlist { fn unique_id(&self) -> u64 { - return private::unique_id(self); + private::unique_id(self) } } @@ -71,7 +83,7 @@ mod private { pub(crate) fn unique_id<T: Hash + Sealed>(object: &T) -> u64 { let mut s = DefaultHasher::new(); object.hash(&mut s); - return s.finish(); + s.finish() } } diff --git a/src/rust/amadeus-rs/lkt-rs/src/main.rs b/src/rust/amadeus-rs/lkt-rs/src/main.rs index 9864808a0973d0e0def07693be61369ad86819e7..fc6376caa82dc2b0bede805e5699af5241efafce 100644 --- a/src/rust/amadeus-rs/lkt-rs/src/main.rs +++ b/src/rust/amadeus-rs/lkt-rs/src/main.rs @@ -2,7 +2,7 @@ use lkt_lib::{connexion::LektorConnexion, query::LektorQuery, response}; fn main() { let mut lektor = LektorConnexion::new("localhost".to_owned(), 6600).unwrap(); - if let Ok(_) = lektor.send_query(LektorQuery::Ping) {} + if lektor.send_query(LektorQuery::Ping).is_ok() {} if let Ok(res) = lektor.send_query(LektorQuery::CurrentKara) { let mut response = response::LektorFormatedResponse::from(res);