From 615ffbb6c38481d27e49fdb0c1b6ae3aa4ecaf9e Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Fri, 10 May 2024 12:51:10 +0300 Subject: [PATCH 1/7] fix(dependency): upgrade wasm-bindgen because of UB in older version Signed-off-by: Lachezar Lechev --- Cargo.lock | 287 ++++++++++++++++++++++++++++------------------------- Cargo.toml | 2 +- 2 files changed, 151 insertions(+), 138 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5ed4094..7e6c8e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,9 +20,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -44,9 +44,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" [[package]] name = "array-init" @@ -59,9 +59,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "base64" @@ -75,6 +75,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "block-buffer" version = "0.10.4" @@ -92,9 +98,9 @@ checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" [[package]] name = "bumpalo" -version = "3.15.3" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -104,9 +110,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "case" @@ -116,9 +122,9 @@ checksum = "fd6c0e7b807d60291f42f33f58480c0bfafe28ed08286446f45e463728cf9c1c" [[package]] name = "cc" -version = "1.0.88" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" [[package]] name = "cfg-if" @@ -128,9 +134,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -212,7 +218,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.52", + "syn 2.0.61", ] [[package]] @@ -223,7 +229,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.52", + "syn 2.0.61", ] [[package]] @@ -290,9 +296,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -375,7 +381,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.61", ] [[package]] @@ -429,9 +435,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -461,9 +467,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" @@ -479,9 +485,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -540,12 +546,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.4" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "967d6dd42f16dbf0eb8040cb9e477933562684d3918f7d253f2ff9087fb3e7a3" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] @@ -569,15 +575,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.55" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -596,9 +602,9 @@ checksum = "d0e22ff43b231e0e2f87d74984e53ebc73b90ae13397e041214fb07efc64168f" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "localsearch" @@ -635,9 +641,9 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "miniz_oxide" @@ -656,9 +662,9 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "num" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ "num-complex", "num-integer", @@ -669,9 +675,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] @@ -693,9 +699,9 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -704,20 +710,19 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -736,9 +741,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -764,9 +769,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] @@ -779,23 +784,23 @@ checksum = "d0c2a098cd8aaa29f66da27a684ad19f4b7bc886f576abf12f7df4a7391071c7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.61", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -805,9 +810,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -816,9 +821,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "rustc_version" @@ -831,15 +836,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "092474d1a01ea8278f69e6a358998405fae5b8b963ddaeb2b0b04a128bf1dfb0" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "scoped-tls" @@ -849,18 +854,18 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.197" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" dependencies = [ "serde_derive", ] @@ -886,20 +891,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.61", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -908,9 +913,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -928,15 +933,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.6.1" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.4", + "indexmap 2.2.6", "serde", "serde_derive", "serde_json", @@ -946,14 +951,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.6.1" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.61", ] [[package]] @@ -1008,7 +1013,7 @@ dependencies = [ [[package]] name = "stremio-core" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#8d882f5bd071a6c4abc42acc689341c28a4f7e58" +source = "git+https://github.com/Stremio/stremio-core?branch=development#00354fc45ea06b7492731ea68cc2a919609f7f59" dependencies = [ "anyhow", "base64 0.21.7", @@ -1087,14 +1092,14 @@ dependencies = [ [[package]] name = "stremio-derive" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#8d882f5bd071a6c4abc42acc689341c28a4f7e58" +source = "git+https://github.com/Stremio/stremio-core?branch=development#00354fc45ea06b7492731ea68cc2a919609f7f59" dependencies = [ "case", "proc-macro-crate", "proc-macro2", "proc_macro_roids", "quote", - "syn 2.0.52", + "syn 2.0.61", ] [[package]] @@ -1121,7 +1126,7 @@ dependencies = [ [[package]] name = "stremio-watched-bitfield" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#8d882f5bd071a6c4abc42acc689341c28a4f7e58" +source = "git+https://github.com/Stremio/stremio-core?branch=development#00354fc45ea06b7492731ea68cc2a919609f7f59" dependencies = [ "base64 0.13.1", "flate2", @@ -1153,7 +1158,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.52", + "syn 2.0.61", ] [[package]] @@ -1169,9 +1174,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" dependencies = [ "proc-macro2", "quote", @@ -1180,22 +1185,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.61", ] [[package]] @@ -1210,9 +1215,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -1231,9 +1236,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -1266,7 +1271,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.4", + "indexmap 2.2.6", "toml_datetime", "winnow", ] @@ -1290,7 +1295,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.61", ] [[package]] @@ -1383,9 +1388,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "serde", @@ -1395,24 +1400,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.61", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.28" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -1422,9 +1427,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1432,28 +1437,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.61", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-bindgen-test" -version = "0.3.28" +version = "0.3.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96f1aa7971fdf61ef0f353602102dbea75a56e225ed036c1e3740564b91e6b7e" +checksum = "d9bf62a58e0780af3e852044583deee40983e5886da43a271dd772379987667b" dependencies = [ "console_error_panic_hook", "js-sys", @@ -1465,19 +1470,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.28" +version = "0.3.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6006f79628dfeb96a86d4db51fbf1344cd7fd8408f06fc9aa3c84913a4789688" +checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" dependencies = [ "proc-macro2", "quote", + "syn 2.0.61", ] [[package]] name = "web-sys" -version = "0.3.55" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -1494,13 +1500,14 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", + "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", @@ -1509,45 +1516,51 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" diff --git a/Cargo.toml b/Cargo.toml index 5332bf2..e6da691 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ enclose = "1.1.*" itertools = "0.10.*" boolinator = "2.4.*" Inflector = "0.11.*" -wasm-bindgen = { version = "=0.2.78", features = ["serde-serialize"] } +wasm-bindgen = { version = "=0.2.92", features = ["serde-serialize"] } wasm-bindgen-futures = "0.4" gloo-utils = { version = "0.2", features = ["serde"] } From ccddcb2d623a9ad0bd9aaf0d66c0fc6cf3a607ce Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Fri, 10 May 2024 12:52:17 +0300 Subject: [PATCH 2/7] chore: update core to latest revision Signed-off-by: Lachezar Lechev --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7e6c8e7..6fda9fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1013,7 +1013,7 @@ dependencies = [ [[package]] name = "stremio-core" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#00354fc45ea06b7492731ea68cc2a919609f7f59" +source = "git+https://github.com/Stremio/stremio-core?branch=development#4a0b991968e1cb4e8bdb60c51536b39727aaea9d" dependencies = [ "anyhow", "base64 0.21.7", @@ -1092,7 +1092,7 @@ dependencies = [ [[package]] name = "stremio-derive" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#00354fc45ea06b7492731ea68cc2a919609f7f59" +source = "git+https://github.com/Stremio/stremio-core?branch=development#4a0b991968e1cb4e8bdb60c51536b39727aaea9d" dependencies = [ "case", "proc-macro-crate", @@ -1126,7 +1126,7 @@ dependencies = [ [[package]] name = "stremio-watched-bitfield" version = "0.1.0" -source = "git+https://github.com/Stremio/stremio-core?branch=development#00354fc45ea06b7492731ea68cc2a919609f7f59" +source = "git+https://github.com/Stremio/stremio-core?branch=development#4a0b991968e1cb4e8bdb60c51536b39727aaea9d" dependencies = [ "base64 0.13.1", "flate2", From d5f47cc3f273418fdc91fefcc9703da503a54125 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 14 May 2024 08:32:20 +0200 Subject: [PATCH 3/7] fix: downgrade wasm bindgen to 0.2.78 --- Cargo.lock | 47 +++++++++++++++++++++++------------------------ Cargo.toml | 2 +- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6fda9fc..64e4217 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -581,9 +581,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" dependencies = [ "wasm-bindgen", ] @@ -1388,9 +1388,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" dependencies = [ "cfg-if", "serde", @@ -1400,24 +1400,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" dependencies = [ "bumpalo", + "lazy_static", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.61", + "syn 1.0.109", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" dependencies = [ "cfg-if", "js-sys", @@ -1427,9 +1427,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1437,28 +1437,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" [[package]] name = "wasm-bindgen-test" -version = "0.3.42" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bf62a58e0780af3e852044583deee40983e5886da43a271dd772379987667b" +checksum = "96f1aa7971fdf61ef0f353602102dbea75a56e225ed036c1e3740564b91e6b7e" dependencies = [ "console_error_panic_hook", "js-sys", @@ -1470,20 +1470,19 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.42" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" +checksum = "6006f79628dfeb96a86d4db51fbf1344cd7fd8408f06fc9aa3c84913a4789688" dependencies = [ "proc-macro2", "quote", - "syn 2.0.61", ] [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index e6da691..5332bf2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ enclose = "1.1.*" itertools = "0.10.*" boolinator = "2.4.*" Inflector = "0.11.*" -wasm-bindgen = { version = "=0.2.92", features = ["serde-serialize"] } +wasm-bindgen = { version = "=0.2.78", features = ["serde-serialize"] } wasm-bindgen-futures = "0.4" gloo-utils = { version = "0.2", features = ["serde"] } From 34f71b9b9b6a854f0e2c4a4ece522ebb1c16cbf3 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Tue, 14 May 2024 16:12:22 +0300 Subject: [PATCH 4/7] feat(config.toml): add `ww` alias for watch-wasm Signed-off-by: Lachezar Lechev --- .cargo/config.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cargo/config.toml b/.cargo/config.toml index a96e612..7f9df0f 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,4 +2,5 @@ [alias] # Requires cargo-watch +ww = ["watch-wasm"] watch-wasm = ["watch", "--shell", "./scripts/build.sh --dev"] \ No newline at end of file From 4205f4cb5a4d37a8877e676b1fcf53aa1bce41b5 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Wed, 15 May 2024 16:28:06 +0300 Subject: [PATCH 5/7] chore: remove debug info log Signed-off-by: Lachezar Lechev --- src/model/serialize_meta_details.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/model/serialize_meta_details.rs b/src/model/serialize_meta_details.rs index 4d0e0c5..718005e 100644 --- a/src/model/serialize_meta_details.rs +++ b/src/model/serialize_meta_details.rs @@ -113,7 +113,6 @@ pub fn serialize_meta_details( .iter() .all(|meta_item| matches!(&meta_item.content, Some(Loadable::Err(_)))) { - tracing::info!("All errored: {:?}", meta_details.meta_items); meta_details.meta_items.first() } else { meta_details From 1bbaa36e40900572d65b3aafeded58ed8982271c Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Mon, 27 May 2024 10:54:24 +0300 Subject: [PATCH 6/7] fix: set Rust version to 1.77 in CI and repo Signed-off-by: Lachezar Lechev --- .github/workflows/build.yml | 2 +- .github/workflows/prerelease.yml | 2 +- .github/workflows/publish.yml | 2 +- rust-toolchain.toml | 6 ++++++ 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 rust-toolchain.toml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 75d54ed..12298eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v4 - name: Rust setup - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@1.77 with: components: rustfmt, clippy targets: wasm32-unknown-unknown diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index c5a3840..f3ddf8d 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -22,7 +22,7 @@ jobs: registry-url: https://registry.npmjs.org/ - name: Rust setup - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@1.77 with: targets: wasm32-unknown-unknown diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b315f74..298cbf8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,7 +24,7 @@ jobs: # For releasing we always use stable - name: Rust setup - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@1.77 with: targets: wasm32-unknown-unknown - uses: taiki-e/install-action@v2 diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..f0d444c --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,6 @@ +[toolchain] +# 1.78 introduces a check which fails on the older +# version of wasm-bindgen, while the newest wasm-bindgen +# introduces an unknown panic when transpiled using +# wasm2js +channel = "1.77" \ No newline at end of file From f0edb336270ac6a6c1c9b9a47a1d50f53e2c89aa Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Mon, 27 May 2024 10:58:23 +0300 Subject: [PATCH 7/7] chore: add expect() instead of unwrap() to track panicking Signed-off-by: Lachezar Lechev --- src/env.rs | 71 +++++++++++-------- src/model/model.rs | 8 +-- src/model/serialize_catalogs_with_extra.rs | 2 +- .../serialize_continue_watching_preview.rs | 2 +- src/model/serialize_ctx.rs | 2 +- src/model/serialize_data_export.rs | 2 +- src/model/serialize_discover.rs | 7 +- src/model/serialize_installed_addons.rs | 2 +- src/model/serialize_library.rs | 2 +- src/model/serialize_local_search.rs | 2 +- src/model/serialize_meta_details.rs | 2 +- src/model/serialize_player.rs | 2 +- src/model/serialize_remote_addons.rs | 2 +- src/model/serialize_streaming_server.rs | 2 +- src/stremio_core_web.rs | 13 ++-- 15 files changed, 68 insertions(+), 53 deletions(-) diff --git a/src/env.rs b/src/env.rs index bb45f9d..3c67c47 100644 --- a/src/env.rs +++ b/src/env.rs @@ -55,7 +55,8 @@ lazy_static! { static ref VISIT_ID: String = hex::encode(WebEnv::random_buffer(10)); static ref ANALYTICS: Analytics = Default::default(); static ref PLAYER_REGEX: Regex = - Regex::new(r"^/player/([^/]*)(?:/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*))?$").unwrap(); + Regex::new(r"^/player/([^/]*)(?:/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*))?$") + .expect("Player Regex failed to build"); } #[derive(Serialize)] @@ -274,7 +275,8 @@ impl Env for WebEnv { let value = String::from_utf8_lossy(value.as_bytes()).into_owned(); headers.entry(key).or_insert_with(Vec::new).push(value); } - ::from_serde(&headers).unwrap() + ::from_serde(&headers) + .expect("WebEnv::fetch: JsValue from Headers failed to be built") }; let body = match serde_json::to_string(&body) { Ok(ref body) if body != "null" && parts.method != Method::GET => { @@ -301,7 +303,9 @@ impl Env for WebEnv { ) })?; - let resp = resp.dyn_into::().unwrap(); + let resp = resp + .dyn_into::() + .expect("WebEnv::fetch: Response into web_sys::Response failed to be built"); // status check and JSON extraction from response. let resp = if resp.status() != 200 { return Err(EnvError::Fetch(format!( @@ -311,8 +315,21 @@ impl Env for WebEnv { } else { // Response.json() to JSON::Stringify - JsFuture::from(resp.text().unwrap()) - .map_err(|error| { + JsFuture::from( + resp.text() + .expect("WebEnv::fetch: Response text failed to be retrieved"), + ) + .map_err(|error| { + EnvError::Fetch( + error + .dyn_into::() + .map(|error| String::from(error.message())) + .unwrap_or_else(|_| UNKNOWN_ERROR.to_owned()), + ) + }) + .await + .and_then(|js_value| { + js_value.dyn_into::().map_err(|error| { EnvError::Fetch( error .dyn_into::() @@ -320,17 +337,7 @@ impl Env for WebEnv { .unwrap_or_else(|_| UNKNOWN_ERROR.to_owned()), ) }) - .await - .and_then(|js_value| { - js_value.dyn_into::().map_err(|error| { - EnvError::Fetch( - error - .dyn_into::() - .map(|error| String::from(error.message())) - .unwrap_or_else(|_| UNKNOWN_ERROR.to_owned()), - ) - }) - })? + })? }; response_deserialize(resp) @@ -444,7 +451,7 @@ impl Env for WebEnv { visit_id: VISIT_ID.to_owned(), path: sanitize_location_path(path), }) - .unwrap() + .expect("AnalyticsContext to JSON") } #[cfg(debug_assertions)] @@ -462,20 +469,22 @@ fn sanitize_location_path(path: &str) -> String { .unwrap_or_default(); let path = match PLAYER_REGEX.captures(url.path()) { Some(captures) => { - if captures.get(3).is_some() - && captures.get(4).is_some() - && captures.get(5).is_some() - && captures.get(6).is_some() - { - format!( - "/player/***/***/{}/{}/{}/{}", - captures.get(3).unwrap().as_str(), - captures.get(4).unwrap().as_str(), - captures.get(5).unwrap().as_str(), - captures.get(6).unwrap().as_str(), - ) - } else { - "/player/***".to_owned() + match ( + captures.get(3), + captures.get(4), + captures.get(5), + captures.get(6), + ) { + (Some(match_3), Some(match_4), Some(match_5), Some(match_6)) => { + format!( + "/player/***/***/{cap_3}/{cap_4}/{cap_5}/{cap_6}", + cap_3 = match_3.as_str(), + cap_4 = match_4.as_str(), + cap_5 = match_5.as_str(), + cap_6 = match_6.as_str(), + ) + } + _ => "/player/***".to_owned(), } } _ => url.path().to_owned(), diff --git a/src/model/model.rs b/src/model/model.rs index 2c9841e..8037898 100644 --- a/src/model/model.rs +++ b/src/model/model.rs @@ -124,9 +124,8 @@ impl WebModel { pub fn get_state(&self, field: &WebModelField) -> JsValue { match field { WebModelField::Ctx => serialize_ctx(&self.ctx), - WebModelField::AuthLink => { - ::from_serde(&self.auth_link).unwrap() - } + WebModelField::AuthLink => ::from_serde(&self.auth_link) + .expect("JsValue from AuthLink"), WebModelField::DataExport => serialize_data_export(&self.data_export), WebModelField::ContinueWatchingPreview => serialize_continue_watching_preview( &self.continue_watching_preview, @@ -158,7 +157,8 @@ impl WebModel { WebModelField::RemoteAddons => serialize_remote_addons(&self.remote_addons, &self.ctx), WebModelField::InstalledAddons => serialize_installed_addons(&self.installed_addons), WebModelField::AddonDetails => { - ::from_serde(&self.addon_details).unwrap() + ::from_serde(&self.addon_details) + .expect("JsValue from AddonDetails") } WebModelField::StreamingServer => serialize_streaming_server(&self.streaming_server), WebModelField::Player => { diff --git a/src/model/serialize_catalogs_with_extra.rs b/src/model/serialize_catalogs_with_extra.rs index 86536a3..9617902 100644 --- a/src/model/serialize_catalogs_with_extra.rs +++ b/src/model/serialize_catalogs_with_extra.rs @@ -129,5 +129,5 @@ pub fn serialize_catalogs_with_extra( ) .collect::>(), }) - .unwrap() + .expect("JsValue from model::CatalogsWithExtra") } diff --git a/src/model/serialize_continue_watching_preview.rs b/src/model/serialize_continue_watching_preview.rs index 59286b2..4545820 100644 --- a/src/model/serialize_continue_watching_preview.rs +++ b/src/model/serialize_continue_watching_preview.rs @@ -19,7 +19,7 @@ pub fn serialize_continue_watching_preview( streaming_server_url, settings, ))) - .unwrap() + .expect("JsValue from model::ContinueWatchingPreview") } mod model { diff --git a/src/model/serialize_ctx.rs b/src/model/serialize_ctx.rs index 03ffb9f..216bbf6 100644 --- a/src/model/serialize_ctx.rs +++ b/src/model/serialize_ctx.rs @@ -4,7 +4,7 @@ use wasm_bindgen::JsValue; use stremio_core::models::ctx::Ctx; pub fn serialize_ctx(ctx: &Ctx) -> JsValue { - ::from_serde(&model::Ctx::from(ctx)).unwrap() + ::from_serde(&model::Ctx::from(ctx)).expect("JsValue from Ctx") } mod model { diff --git a/src/model/serialize_data_export.rs b/src/model/serialize_data_export.rs index 71b8e36..1ce6d5e 100644 --- a/src/model/serialize_data_export.rs +++ b/src/model/serialize_data_export.rs @@ -22,5 +22,5 @@ pub fn serialize_data_export(data_export: &DataExport) -> JsValue { .as_ref() .map(|(_auth_key, loadable)| loadable), }) - .unwrap() + .expect("JsValue from model::DataExport") } diff --git a/src/model/serialize_discover.rs b/src/model/serialize_discover.rs index 590c4a0..beb4631 100644 --- a/src/model/serialize_discover.rs +++ b/src/model/serialize_discover.rs @@ -167,7 +167,10 @@ pub fn serialize_discover( next_page: discover.selectable.next_page.is_some(), }, catalog: (!discover.catalog.is_empty()).as_option().map(|_| { - let first_page = discover.catalog.first().unwrap(); + let first_page = discover + .catalog + .first() + .expect("discover catalog first page"); model::ResourceLoadable { content: match &first_page.content { Some(Loadable::Ready(_)) => Loadable::Ready( @@ -228,5 +231,5 @@ pub fn serialize_discover( } }), }) - .unwrap() + .expect("JsValue from Discover model::CatalogWithFilters") } diff --git a/src/model/serialize_installed_addons.rs b/src/model/serialize_installed_addons.rs index e974791..4893ace 100644 --- a/src/model/serialize_installed_addons.rs +++ b/src/model/serialize_installed_addons.rs @@ -76,5 +76,5 @@ pub fn serialize_installed_addons(installed_addons: &InstalledAddonsWithFilters) }) .collect(), }) - .unwrap() + .expect("JsValue from model::InstalledAddonsWithFilters") } diff --git a/src/model/serialize_library.rs b/src/model/serialize_library.rs index 44e7e88..d650cf8 100644 --- a/src/model/serialize_library.rs +++ b/src/model/serialize_library.rs @@ -133,5 +133,5 @@ pub fn serialize_library( }) .collect(), }) - .unwrap() + .expect("JsValue from model::LibraryWithFilters") } diff --git a/src/model/serialize_local_search.rs b/src/model/serialize_local_search.rs index 15f391e..d7eca48 100644 --- a/src/model/serialize_local_search.rs +++ b/src/model/serialize_local_search.rs @@ -39,5 +39,5 @@ pub fn serialize_local_search(local_search: &LocalSearch) -> JsValue { .unique_by(|i| i.query) .collect(), }) - .unwrap() + .expect("JsValue from model::LocalSearch") } diff --git a/src/model/serialize_meta_details.rs b/src/model/serialize_meta_details.rs index 4d0e0c5..cf43fab 100644 --- a/src/model/serialize_meta_details.rs +++ b/src/model/serialize_meta_details.rs @@ -376,5 +376,5 @@ pub fn serialize_meta_details( .unwrap_or_else(|| meta_item.preview.name.to_owned()) }), }) - .unwrap() + .expect("JsValue from model::MetaDetails") } diff --git a/src/model/serialize_player.rs b/src/model/serialize_player.rs index 9311ea1..480f16b 100644 --- a/src/model/serialize_player.rs +++ b/src/model/serialize_player.rs @@ -304,5 +304,5 @@ pub fn serialize_player(player: &Player, ctx: &Ctx, streaming_server: &Streaming }, }), }) - .unwrap() + .expect("JsValue from model::Player") } diff --git a/src/model/serialize_remote_addons.rs b/src/model/serialize_remote_addons.rs index 14b9ff3..6611410 100644 --- a/src/model/serialize_remote_addons.rs +++ b/src/model/serialize_remote_addons.rs @@ -107,5 +107,5 @@ pub fn serialize_remote_addons( }, }), }) - .unwrap() + .expect("JsValue from model::CatalogWithFilters") } diff --git a/src/model/serialize_streaming_server.rs b/src/model/serialize_streaming_server.rs index cb78a6d..c28cb39 100644 --- a/src/model/serialize_streaming_server.rs +++ b/src/model/serialize_streaming_server.rs @@ -53,5 +53,5 @@ pub fn serialize_streaming_server(streaming_server: &StreamingServer) -> JsValue }), statistics: streaming_server.statistics.as_ref(), }) - .unwrap() + .expect("JsValue from model::StreamingServer") } diff --git a/src/stremio_core_web.rs b/src/stremio_core_web.rs index 59553cc..1688a8e 100644 --- a/src/stremio_core_web.rs +++ b/src/stremio_core_web.rs @@ -133,7 +133,7 @@ pub async fn initialize_runtime(emit_to_ui: js_sys::Function) -> Result<(), JsVa )); }; emit_to_ui - .call1(&JsValue::NULL, &::from_serde(&event).unwrap()) + .call1(&JsValue::NULL, &::from_serde(&event).expect("Event handler: JsValue from Event")) .expect("emit event failed"); future::ready(()) })); @@ -144,13 +144,14 @@ pub async fn initialize_runtime(emit_to_ui: js_sys::Function) -> Result<(), JsVa Err(error) => { *RUNTIME.write().expect("runtime write failed") = Some(Loadable::Err(error.to_owned())); - Err(::from_serde(&error).unwrap()) + Err(::from_serde(&error) + .expect("Storage: JsValue from Event")) } } } Err(error) => { *RUNTIME.write().expect("runtime write failed") = Some(Loadable::Err(error.to_owned())); - Err(::from_serde(&error).unwrap()) + Err(::from_serde(&error).expect("JsValue from Event")) } } } @@ -165,7 +166,7 @@ pub fn get_debug_state() -> JsValue { .as_ref() .expect("runtime is not ready"); let model = runtime.model().expect("model read failed"); - ::from_serde(&*model).unwrap() + ::from_serde(&*model).expect("JsValue from WebModel") } #[wasm_bindgen] @@ -230,7 +231,9 @@ pub fn analytics(event: JsValue, location_hash: JsValue) { pub fn decode_stream(stream: JsValue) -> JsValue { let stream = stream.as_string().map(Stream::decode); match stream { - Some(Ok(stream)) => ::from_serde(&stream).unwrap(), + Some(Ok(stream)) => { + ::from_serde(&stream).expect("JsValue from Stream") + } _ => JsValue::NULL, } }