diff --git a/Cargo.lock b/Cargo.lock index 2b7fca1..b962db0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,152 +4,31 @@ version = 4 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "async-broadcast" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" -dependencies = [ - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.2.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" dependencies = [ - "concurrent-queue", - "event-listener 5.3.1", - "event-listener-strategy 0.5.0", + "event-listener", + "event-listener-strategy", "futures-core", "pin-project-lite", ] -[[package]] -name = "async-executor" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand 2.0.2", - "futures-lite 2.3.0", - "slab", -] - -[[package]] -name = "async-fs" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "blocking", - "futures-lite 1.13.0", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" -dependencies = [ - "async-lock 3.3.0", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.3.0", - "parking", - "polling 3.6.0", - "rustix 0.38.32", - "slab", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" -dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", - "pin-project-lite", -] - -[[package]] -name = "async-process" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" -dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", - "async-signal", - "blocking", - "cfg-if", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.32", - "windows-sys 0.48.0", -] - [[package]] name = "async-recursion" version = "1.1.1" @@ -158,49 +37,25 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.96", ] -[[package]] -name = "async-signal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" -dependencies = [ - "async-io 2.3.2", - "async-lock 2.8.0", - "atomic-waker", - "cfg-if", - "futures-core", - "futures-io", - "rustix 0.38.32", - "signal-hook-registry", - "slab", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.96", ] [[package]] name = "atk" -version = "0.18.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4af014b17dd80e8af9fa689b2d4a211ddba6eb583c1622f35d0cb543f6b17e4" +checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" dependencies = [ "atk-sys", "glib", @@ -209,9 +64,9 @@ dependencies = [ [[package]] name = "atk-sys" -version = "0.18.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "251e0b7d90e33e0ba930891a505a9a35ece37b2dd37a14f3ffc306c13b980009" +checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" dependencies = [ "glib-sys 0.18.1", "gobject-sys 0.18.0", @@ -219,78 +74,38 @@ dependencies = [ "system-deps 6.2.2", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets", ] [[package]] name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "blocking" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" -dependencies = [ - "async-channel", - "async-task", - "futures-io", - "futures-lite 2.3.0", - "piper", -] - -[[package]] -name = "byteorder" -version = "1.5.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cairo-rs" @@ -298,7 +113,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ - "bitflags 2.6.0", + "bitflags", "cairo-sys-rs", "glib", "libc", @@ -317,12 +132,6 @@ dependencies = [ "system-deps 6.2.2", ] -[[package]] -name = "cc" -version = "1.0.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" - [[package]] name = "cfg-expr" version = "0.15.8" @@ -335,9 +144,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.17.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c360837f8f19e2e4468275138f1c0dec1647d1e17bb7c0215fe3cd7530e93c25" +checksum = "8d4ba6e40bd1184518716a6e1a781bf9160e286d219ccdb8ab2612e74cfe4789" dependencies = [ "smallvec", "target-lexicon", @@ -350,38 +159,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "concurrent-queue" -version = "2.4.0" +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" -dependencies = [ - "crossbeam-utils", -] +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] -name = "cpufeatures" -version = "0.2.15" +name = "concurrent-queue" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "libc", + "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - -[[package]] -name = "crypto-common" -version = "0.1.6" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "dbusmenu-glib-sys" @@ -389,8 +185,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ff9ed40330718c94342b953c997ac19d840db07a7710fe35b45a5d3a3a1d6eb" dependencies = [ - "glib-sys 0.20.6", - "gobject-sys 0.20.4", + "glib-sys 0.20.7", + "gobject-sys 0.20.7", "libc", "system-deps 6.2.2", ] @@ -402,41 +198,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f30ba5f8aec0e38a84c579bc8ee3db6f6417b201e729fdd96a23d1f61cb6eca" dependencies = [ "dbusmenu-glib-sys", - "gdk-pixbuf-sys 0.20.4", + "gdk-pixbuf-sys 0.20.7", "gdk-sys", - "glib-sys 0.20.6", - "gobject-sys 0.20.4", + "glib-sys 0.20.7", + "gobject-sys 0.20.7", "gtk-sys", "libc", "system-deps 6.2.2", ] [[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.10.7" +name = "endi" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" [[package]] name = "enumflags2" -version = "0.7.9" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" +checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" dependencies = [ "enumflags2_derive", "serde", @@ -444,13 +225,13 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.9" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" +checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.96", ] [[package]] @@ -461,47 +242,19 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "event-listener" -version = "2.5.3" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" dependencies = [ "concurrent-queue", "parking", @@ -510,38 +263,19 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.4.0" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" dependencies = [ - "event-listener 4.0.3", + "event-listener", "pin-project-lite", ] -[[package]] -name = "event-listener-strategy" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" -dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" -version = "2.0.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "field-offset" @@ -549,30 +283,30 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ - "memoffset 0.9.1", + "memoffset", "rustc_version", ] [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -581,73 +315,36 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-lite" -version = "2.3.0" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" -dependencies = [ - "fastrand 2.0.2", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.96", ] -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", - "futures-io", "futures-macro", - "futures-sink", "futures-task", - "memchr", "pin-project-lite", "pin-utils", "slab", @@ -655,9 +352,9 @@ dependencies = [ [[package]] name = "gdk" -version = "0.18.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5ba081bdef3b75ebcdbfc953699ed2d7417d6bd853347a42a37d76406a33646" +checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" dependencies = [ "cairo-rs", "gdk-pixbuf", @@ -696,22 +393,22 @@ dependencies = [ [[package]] name = "gdk-pixbuf-sys" -version = "0.20.4" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "687343b059b91df5f3fbd87b4307038fa9e647fcc0461d0d3f93e94fee20bf3d" +checksum = "67f2587c9202bf997476bbba6aaed4f78a11538a2567df002a5f57f5331d0b5c" dependencies = [ - "gio-sys 0.20.6", - "glib-sys 0.20.6", - "gobject-sys 0.20.4", + "gio-sys 0.20.8", + "glib-sys 0.20.7", + "gobject-sys 0.20.7", "libc", "system-deps 7.0.3", ] [[package]] name = "gdk-sys" -version = "0.18.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31ff856cb3386dae1703a920f803abafcc580e9b5f711ca62ed1620c25b51ff2" +checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys 0.18.0", @@ -724,16 +421,6 @@ dependencies = [ "system-deps 6.2.2", ] -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - [[package]] name = "getrandom" version = "0.2.15" @@ -747,9 +434,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gio" @@ -785,15 +472,15 @@ dependencies = [ [[package]] name = "gio-sys" -version = "0.20.6" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b965df6f3534c84816b5c1a7d9efcb5671ae790822de5abe8e299797039529bc" +checksum = "8446d9b475730ebef81802c1738d972db42fde1c5a36a627ebc4d665fc87db04" dependencies = [ - "glib-sys 0.20.6", - "gobject-sys 0.20.4", + "glib-sys 0.20.7", + "gobject-sys 0.20.7", "libc", "system-deps 7.0.3", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -802,7 +489,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" dependencies = [ - "bitflags 2.6.0", + "bitflags", "futures-channel", "futures-core", "futures-executor", @@ -830,7 +517,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.96", ] [[package]] @@ -845,9 +532,9 @@ dependencies = [ [[package]] name = "glib-sys" -version = "0.20.6" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d0b1827e8621fc42c0dfb228e5d57ff6a71f9699e666ece8113f979ad87c2de" +checksum = "b360ff0f90d71de99095f79c526a5888c9c92fc9ee1b19da06c6f5e75f0c2a53" dependencies = [ "libc", "system-deps 7.0.3", @@ -866,20 +553,20 @@ dependencies = [ [[package]] name = "gobject-sys" -version = "0.20.4" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c674d2ff8478cf0ec29d2be730ed779fef54415a2fb4b565c52def62696462" +checksum = "67a56235e971a63bfd75abb13ef70064e1346388723422a68580d8a6fbac6423" dependencies = [ - "glib-sys 0.20.6", + "glib-sys 0.20.7", "libc", "system-deps 7.0.3", ] [[package]] name = "gtk" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93c4f5e0e20b60e10631a5f06da7fe3dda744b05ad0ea71fee2f47adf865890c" +checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" dependencies = [ "atk", "cairo-rs", @@ -898,9 +585,9 @@ dependencies = [ [[package]] name = "gtk-sys" -version = "0.18.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771437bf1de2c1c0b496c11505bdf748e26066bbe942dfc8f614c9460f6d7722" +checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" dependencies = [ "atk-sys", "cairo-sys-rs", @@ -916,22 +603,22 @@ dependencies = [ [[package]] name = "gtk3-macros" -version = "0.18.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6063efb63db582968fb7df72e1ae68aa6360dcfb0a75143f34fc7d616bad75e" +checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.96", ] [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -945,12 +632,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "hex" version = "0.4.3" @@ -959,57 +640,25 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "libc" -version = "0.2.164" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "log" -version = "0.4.22" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "memchr" @@ -1017,15 +666,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.9.1" @@ -1037,20 +677,19 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi", "libc", "wasi", "windows-sys 0.52.0", @@ -1058,30 +697,31 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.4" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 1.3.2", + "bitflags", "cfg-if", + "cfg_aliases", "libc", - "memoffset 0.7.1", + "memoffset", ] [[package]] name = "object" -version = "0.32.2" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "ordered-stream" @@ -1120,15 +760,15 @@ dependencies = [ [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1136,63 +776,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "piper" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" -dependencies = [ - "atomic-waker", - "fastrand 2.0.2", - "futures-io", -] - [[package]] name = "pkg-config" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - -[[package]] -name = "polling" -version = "3.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi", - "pin-project-lite", - "rustix 0.38.32", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] - [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -1212,6 +801,15 @@ dependencies = [ "toml_edit 0.20.7", ] +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit 0.22.22", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1238,86 +836,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" @@ -1330,55 +869,41 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.27" +version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 1.3.2", + "bitflags", "errno", - "io-lifetimes", "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys 0.4.13", - "windows-sys 0.52.0", + "linux-raw-sys", + "windows-sys 0.59.0", ] [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.96", ] [[package]] @@ -1389,7 +914,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.96", ] [[package]] @@ -1401,22 +926,11 @@ dependencies = [ "serde", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -1438,19 +952,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1469,15 +973,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", - "quote", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.87" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -1503,7 +1006,7 @@ version = "7.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66d23aaf9f331227789a99e8de4c91bf46703add012bdfd45fdecdfb2975a005" dependencies = [ - "cfg-expr 0.17.1", + "cfg-expr 0.17.2", "heck 0.5.0", "pkg-config", "toml", @@ -1517,7 +1020,7 @@ dependencies = [ "dbusmenu-gtk3-sys", "gtk", "serde", - "thiserror 2.0.7", + "thiserror 2.0.11", "tokio", "tracing", "zbus", @@ -1531,14 +1034,16 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", - "fastrand 2.0.2", - "rustix 0.38.32", - "windows-sys 0.52.0", + "fastrand", + "getrandom", + "once_cell", + "rustix", + "windows-sys 0.59.0", ] [[package]] @@ -1552,11 +1057,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.7" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ - "thiserror-impl 2.0.7", + "thiserror-impl 2.0.11", ] [[package]] @@ -1567,25 +1072,25 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.96", ] [[package]] name = "thiserror-impl" -version = "2.0.7" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.96", ] [[package]] name = "tokio" -version = "1.42.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -1593,7 +1098,7 @@ dependencies = [ "mio", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", + "socket2", "tokio-macros", "tracing", "windows-sys 0.52.0", @@ -1601,13 +1106,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.96", ] [[package]] @@ -1663,7 +1168,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.20", + "winnow 0.6.24", ] [[package]] @@ -1685,7 +1190,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.96", ] [[package]] @@ -1697,28 +1202,22 @@ dependencies = [ "once_cell", ] -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - [[package]] name = "uds_windows" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ - "memoffset 0.9.1", + "memoffset", "tempfile", "winapi", ] [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "version-compare" @@ -1732,12 +1231,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "waker-fn" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1766,37 +1259,22 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -1805,46 +1283,28 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -1857,48 +1317,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -1916,59 +1352,47 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] [[package]] name = "xdg-home" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" dependencies = [ "libc", - "winapi", + "windows-sys 0.59.0", ] [[package]] name = "zbus" -version = "3.15.2" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" +checksum = "2494e4b3f44d8363eef79a8a75fc0649efb710eef65a66b5e688a5eb4afe678a" dependencies = [ "async-broadcast", - "async-executor", - "async-fs", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-process", "async-recursion", - "async-task", "async-trait", - "blocking", - "byteorder", - "derivative", "enumflags2", - "event-listener 2.5.3", + "event-listener", "futures-core", - "futures-sink", "futures-util", "hex", "nix", - "once_cell", "ordered-stream", - "rand", "serde", "serde_repr", - "sha1", "static_assertions", "tokio", "tracing", "uds_windows", - "winapi", + "windows-sys 0.59.0", + "winnow 0.6.24", "xdg-home", "zbus_macros", "zbus_names", @@ -1977,84 +1401,69 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.15.2" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7131497b0f887e8061b430c530240063d33bf9455fa34438f388a245da69e0a5" +checksum = "445efc01929302aee95e2b25bbb62a301ea8a6369466e4278e58e7d1dfb23631" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "regex", - "syn 1.0.109", + "syn 2.0.96", + "zbus_names", + "zvariant", "zvariant_utils", ] [[package]] name = "zbus_names" -version = "2.6.1" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d" +checksum = "519629a3f80976d89c575895b05677cbc45eaf9f70d62a364d819ba646409cc8" dependencies = [ "serde", "static_assertions", + "winnow 0.6.24", "zvariant", ] -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "byteorder", - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "zvariant" -version = "3.15.2" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eef2be88ba09b358d3b58aca6e41cd853631d44787f319a1383ca83424fb2db" +checksum = "55e6b9b5f1361de2d5e7d9fd1ee5f6f7fcb6060618a1f82f3472f58f2b8d4be9" dependencies = [ - "byteorder", + "endi", "enumflags2", - "libc", "serde", "static_assertions", + "winnow 0.6.24", "zvariant_derive", + "zvariant_utils", ] [[package]] name = "zvariant_derive" -version = "3.15.2" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c24dc0bed72f5f90d1f8bb5b07228cbf63b3c6e9f82d82559d4bae666e7ed9" +checksum = "573a8dd76961957108b10f7a45bac6ab1ea3e9b7fe01aff88325dc57bb8f5c8b" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.96", "zvariant_utils", ] [[package]] name = "zvariant_utils" -version = "1.0.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" +checksum = "ddd46446ea2a1f353bfda53e35f17633afa79f4fe290a611c94645c69fe96a50" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "serde", + "static_assertions", + "syn 2.0.96", + "winnow 0.6.24", ] diff --git a/Cargo.toml b/Cargo.toml index d17ff51..0ca0e90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,14 +13,14 @@ default = [] dbusmenu-gtk3 = ["dep:gtk", "dep:dbusmenu-gtk3-sys"] [dependencies] -zbus = { version = "3.15.2", features = ["tokio"] } +zbus = { version = "5.3", default-features = false, features = ["tokio"] } tracing = "0.1.41" -serde = { version = "1.0.216", features = ["derive"] } -tokio = { version = "1.42.0", features = ["rt", "sync", "macros", "time"] } -thiserror = "2.0.7" +serde = { version = "1", features = ["derive"] } +tokio = { version = "1", features = ["rt", "sync", "macros", "time"] } +thiserror = "2.0.11" -gtk = { version = "0.18.1", optional = true } -dbusmenu-gtk3-sys = { version = "0.1.0", optional = true } +gtk = { version = "0.18.1", optional = true } +dbusmenu-gtk3-sys = { version = "0.1.0", optional = true } [dev-dependencies] -tokio = { version = "1.41.1", features = ["rt-multi-thread"] } \ No newline at end of file +tokio = { version = "1.41.1", features = ["rt-multi-thread"] } diff --git a/src/client.rs b/src/client.rs index d915b25..82d56e1 100644 --- a/src/client.rs +++ b/src/client.rs @@ -3,7 +3,7 @@ use crate::dbus::notifier_item_proxy::StatusNotifierItemProxy; use crate::dbus::notifier_watcher_proxy::StatusNotifierWatcherProxy; use crate::dbus::status_notifier_watcher::StatusNotifierWatcher; use crate::dbus::{self, OwnedValueExt}; -use crate::error::Error; +use crate::error::{Error, Result}; use crate::item::{self, Status, StatusNotifierItem, Tooltip}; use crate::menu::{MenuDiff, TrayMenu}; use crate::names; @@ -362,14 +362,20 @@ impl Client { let dbus_proxy = DBusProxy::new(connection).await?; let mut disconnect_stream = dbus_proxy.receive_name_owner_changed().await?; - let mut props_changed = notifier_item_proxy.receive_all_signals().await?; + let mut props_changed = notifier_item_proxy.inner().receive_all_signals().await?; loop { tokio::select! { Some(change) = props_changed.next() => { - if let Some(event) = Self::get_update_event(change, &properties_proxy).await { - debug!("[{destination}{path}] received property change: {event:?}"); - tx.send(Event::Update(destination.to_string(), event))?; + match Self::get_update_event(change, &properties_proxy).await { + Ok(Some(event)) => { + debug!("[{destination}{path}] received property change: {event:?}"); + tx.send(Event::Update(destination.to_string(), event))?; + } + Err(e) => { + error!("Error parsing update properties from {destination}{path}: {e:?}"); + } + _ => {} } } Some(signal) = disconnect_stream.next() => { @@ -402,10 +408,13 @@ impl Client { /// Gets the update event for a `DBus` properties change message. async fn get_update_event( - change: Arc, + change: Message, properties_proxy: &PropertiesProxy<'_>, - ) -> Option { - let member = change.member()?; + ) -> Result> { + let header = change.header(); + let member = header + .member() + .ok_or(Error::InvalidData("Update message header missing `member`"))?; let property_name = match member.as_str() { "NewAttentionIcon" => "AttentionIconName", @@ -417,47 +426,37 @@ impl Client { _ => &member.as_str()["New".len()..], }; - let res = properties_proxy + let property = properties_proxy .get( InterfaceName::from_static_str(PROPERTIES_INTERFACE) .expect("to be valid interface name"), property_name, ) - .await; - - let property = match res { - Ok(property) => property, - Err(err) => { - error!("error fetching property '{property_name}': {err:?}"); - return None; - } - }; + .await?; debug!("received tray item update: {member} -> {property:?}"); use UpdateEvent::*; - match member.as_str() { - "NewAttentionIcon" => Some(AttentionIcon(property.to_string())), - "NewIcon" => Some(Icon(property.to_string())), - "NewOverlayIcon" => Some(OverlayIcon(property.to_string())), + Ok(match member.as_str() { + "NewAttentionIcon" => Some(AttentionIcon(property.to_string().ok())), + "NewIcon" => Some(Icon(property.to_string().ok())), + "NewOverlayIcon" => Some(OverlayIcon(property.to_string().ok())), "NewStatus" => Some(Status( - property - .downcast_ref::() - .map(item::Status::from) - .unwrap_or_default(), + property.downcast_ref::<&str>().map(item::Status::from)?, )), - "NewTitle" => Some(Title(property.to_string())), - "NewToolTip" => Some(Tooltip( + "NewTitle" => Some(Title(property.to_string().ok())), + "NewToolTip" => Some(Tooltip({ property - .downcast_ref::() - .map(crate::item::Tooltip::try_from)? - .ok(), - )), + .downcast_ref::<&Structure>() + .ok() + .map(crate::item::Tooltip::try_from) + .transpose()? + })), _ => { warn!("received unhandled update event: {member}"); None } - } + }) } /// Watches the `DBusMenu` associated with an SNI item. @@ -541,7 +540,8 @@ impl Client { ))?; } Some(change) = properties_updated.next() => { - let update = change.body::()?; + let body = change.message().body(); + let update: PropertiesUpdate= body.deserialize::()?; let diffs = Vec::try_from(update)?; tx.send(Event::Update( diff --git a/src/dbus/dbus_menu_proxy.rs b/src/dbus/dbus_menu_proxy.rs index 5992807..4b44b1a 100644 --- a/src/dbus/dbus_menu_proxy.rs +++ b/src/dbus/dbus_menu_proxy.rs @@ -12,7 +12,7 @@ use std::collections::HashMap; -use zbus::dbus_proxy; +use zbus::proxy; use zbus::zvariant::{OwnedValue, Value}; use serde::{Deserialize, Serialize}; @@ -55,8 +55,8 @@ pub struct RemovedProps<'a> { pub(crate) fields: Vec<&'a str>, } -#[dbus_proxy(interface = "com.canonical.dbusmenu", assume_defaults = true)] -trait DBusMenu { +#[proxy(interface = "com.canonical.dbusmenu", assume_defaults = true)] +pub trait DBusMenu { fn about_to_show(&self, id: i32) -> zbus::Result; fn event( @@ -82,22 +82,22 @@ trait DBusMenu { fn get_property(&self, id: i32, name: &str) -> zbus::Result; - #[dbus_proxy(signal)] + #[zbus(signal)] fn item_activation_requested(&self, id: i32, timestamp: u32) -> zbus::Result<()>; - #[dbus_proxy(signal)] + #[zbus(signal)] fn items_properties_updated( &self, updated_props: Vec<(i32, HashMap<&str, Value<'_>>)>, removed_props: Vec<(i32, Vec<&str>)>, ) -> zbus::Result<()>; - #[dbus_proxy(signal)] + #[zbus(signal)] fn layout_updated(&self, revision: u32, parent: i32) -> zbus::Result<()>; - #[dbus_proxy(property)] + #[zbus(property)] fn status(&self) -> zbus::Result; - #[dbus_proxy(property)] + #[zbus(property)] fn version(&self) -> zbus::Result; } diff --git a/src/dbus/mod.rs b/src/dbus/mod.rs index 7ced101..40b2d99 100644 --- a/src/dbus/mod.rs +++ b/src/dbus/mod.rs @@ -1,3 +1,4 @@ +use crate::error::Result; use std::collections::HashMap; use std::ops::Deref; use zbus::zvariant::{ObjectPath, OwnedValue, Value}; @@ -13,36 +14,42 @@ pub(crate) struct DBusProps(pub HashMap); impl DBusProps { /// Gets `key` from the map if present, /// downcasting it to type `T`. - pub fn get<'a, T>(&'a self, key: &str) -> Option<&'a T> + pub fn get<'a, T>(&'a self, key: &str) -> Option> where T: ?Sized, &'a T: TryFrom<&'a Value<'a>>, + <&'a T as TryFrom<&'a Value<'a>>>::Error: Into, { - self.0.get(key).and_then(|value| value.downcast_ref::()) + self.0 + .get(key) + .map(|v| v.downcast_ref().map_err(Into::into)) } /// Gets `key` from the map if present, /// interpreting it as a `str` /// and converting it to a string. - pub fn get_string(&self, key: &str) -> Option { - self.get::(key).map(ToString::to_string) + pub fn get_string(&self, key: &str) -> Option> { + self.get::(key).map(|res| res.map(ToString::to_string)) } /// Gets `key` from the map if present, /// interpreting it as an `ObjectPath`, /// and converting it to a string. - pub fn get_object_path(&self, key: &str) -> Option { - self.get::(key).map(ToString::to_string) + pub fn get_object_path(&self, key: &str) -> Option> { + self.get::(key) + .map(|res| res.map(ToString::to_string)) } } pub(crate) trait OwnedValueExt { - fn to_string(&self) -> Option; + fn to_string(&self) -> Result; } impl OwnedValueExt for OwnedValue { - fn to_string(&self) -> Option { - self.downcast_ref::().map(ToString::to_string) + fn to_string(&self) -> Result { + self.downcast_ref::<&str>() + .map(ToString::to_string) + .map_err(Into::into) } } diff --git a/src/dbus/notifier_item_proxy.rs b/src/dbus/notifier_item_proxy.rs index 6110013..b7a1e91 100644 --- a/src/dbus/notifier_item_proxy.rs +++ b/src/dbus/notifier_item_proxy.rs @@ -10,13 +10,13 @@ //! section of the zbus documentation. //! -use zbus::dbus_proxy; +use zbus::proxy; #[allow(dead_code)] type ToolTip = (String, Vec<(i32, i32, Vec)>); -#[dbus_proxy(interface = "org.kde.StatusNotifierItem", assume_defaults = true)] -trait StatusNotifierItem { +#[proxy(interface = "org.kde.StatusNotifierItem", assume_defaults = true)] +pub trait StatusNotifierItem { /// Activate method fn activate(&self, x: i32, y: i32) -> zbus::Result<()>; @@ -30,86 +30,86 @@ trait StatusNotifierItem { fn secondary_activate(&self, x: i32, y: i32) -> zbus::Result<()>; /// NewAttentionIcon signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_attention_icon(&self) -> zbus::Result<()>; /// NewIcon signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_icon(&self) -> zbus::Result<()>; /// NewOverlayIcon signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_overlay_icon(&self) -> zbus::Result<()>; /// NewStatus signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_status(&self, status: &str) -> zbus::Result<()>; /// NewTitle signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_title(&self) -> zbus::Result<()>; /// NewToolTip signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_tool_tip(&self) -> zbus::Result<()>; /// AttentionIconName property - #[dbus_proxy(property)] + #[zbus(property)] fn attention_icon_name(&self) -> zbus::Result; /// AttentionIconPixmap property - #[dbus_proxy(property)] + #[zbus(property)] fn attention_icon_pixmap(&self) -> zbus::Result)>>; /// AttentionMovieName property - #[dbus_proxy(property)] + #[zbus(property)] fn attention_movie_name(&self) -> zbus::Result; /// Category property - #[dbus_proxy(property)] + #[zbus(property)] fn category(&self) -> zbus::Result; /// IconName property - #[dbus_proxy(property)] + #[zbus(property)] fn icon_name(&self) -> zbus::Result; /// IconPixmap property - #[dbus_proxy(property)] + #[zbus(property)] fn icon_pixmap(&self) -> zbus::Result)>>; /// IconThemePath property - #[dbus_proxy(property)] + #[zbus(property)] fn icon_theme_path(&self) -> zbus::Result; /// Id property - #[dbus_proxy(property)] + #[zbus(property)] fn id(&self) -> zbus::Result; /// ItemIsMenu property - #[dbus_proxy(property)] + #[zbus(property)] fn item_is_menu(&self) -> zbus::Result; /// Menu property - #[dbus_proxy(property)] + #[zbus(property)] fn menu(&self) -> zbus::Result; /// OverlayIconName property - #[dbus_proxy(property)] + #[zbus(property)] fn overlay_icon_name(&self) -> zbus::Result; /// OverlayIconPixmap property - #[dbus_proxy(property)] + #[zbus(property)] fn overlay_icon_pixmap(&self) -> zbus::Result)>>; /// Status property - #[dbus_proxy(property)] + #[zbus(property)] fn status(&self) -> zbus::Result; /// Title property - #[dbus_proxy(property)] + #[zbus(property)] fn title(&self) -> zbus::Result; /// ToolTip property - #[dbus_proxy(property)] + #[zbus(property)] fn tool_tip(&self) -> zbus::Result; } diff --git a/src/dbus/notifier_watcher_proxy.rs b/src/dbus/notifier_watcher_proxy.rs index 1b038aa..34d145a 100644 --- a/src/dbus/notifier_watcher_proxy.rs +++ b/src/dbus/notifier_watcher_proxy.rs @@ -10,38 +10,38 @@ //! section of the zbus documentation. //! -use zbus::dbus_proxy; +use zbus::proxy; -#[dbus_proxy( +#[proxy( default_service = "org.kde.StatusNotifierWatcher", interface = "org.kde.StatusNotifierWatcher", default_path = "/StatusNotifierWatcher" )] -trait StatusNotifierWatcher { +pub trait StatusNotifierWatcher { fn register_status_notifier_host(&self, service: &str) -> zbus::Result<()>; fn unregister_status_notifier_item(&self, service: &str) -> zbus::Result<()>; fn register_status_notifier_item(&self, service: &str) -> zbus::Result<()>; - #[dbus_proxy(signal)] + #[zbus(signal)] fn status_notifier_host_registered(&self) -> zbus::Result<()>; - #[dbus_proxy(signal)] + #[zbus(signal)] fn status_notifier_host_unregistered(&self) -> zbus::Result<()>; - #[dbus_proxy(signal)] + #[zbus(signal)] fn status_notifier_item_registered(&self, service: &str) -> zbus::Result<()>; - #[dbus_proxy(signal)] + #[zbus(signal)] fn status_notifier_item_unregistered(&self, service: &str) -> zbus::Result<()>; - #[dbus_proxy(property)] + #[zbus(property)] fn is_status_notifier_host_registered(&self) -> zbus::Result; - #[dbus_proxy(property)] + #[zbus(property)] fn protocol_version(&self) -> zbus::Result; - #[dbus_proxy(property)] + #[zbus(property)] fn registered_status_notifier_items(&self) -> zbus::Result>; } diff --git a/src/dbus/status_notifier_watcher.rs b/src/dbus/status_notifier_watcher.rs index 62f9fdb..d0b415d 100644 --- a/src/dbus/status_notifier_watcher.rs +++ b/src/dbus/status_notifier_watcher.rs @@ -1,11 +1,12 @@ use crate::names; +use std::borrow::Cow; use std::collections::HashSet; use std::sync::{Arc, Mutex}; use tracing::{debug, error, info, warn}; -use zbus::{ - dbus_interface, export::ordered_stream::OrderedStreamExt, Connection, Interface, MessageHeader, - SignalContext, -}; +use zbus::message::Header; +use zbus::object_server::Interface; +use zbus::object_server::SignalEmitter; +use zbus::{export::ordered_stream::OrderedStreamExt, interface, Connection}; /// An instance of [`org.kde.StatusNotifierWatcher`]. It only tracks what tray items and trays /// exist, and doesn't have any logic for displaying items (for that, see [`Host`][`crate::Host`]). @@ -25,15 +26,15 @@ pub struct StatusNotifierWatcher { /// /// Methods and properties correspond to methods and properties on the DBus service that can be /// used by others, while signals are events that we generate that other services listen to. -#[dbus_interface(name = "org.kde.StatusNotifierWatcher")] +#[interface(name = "org.kde.StatusNotifierWatcher")] impl StatusNotifierWatcher { /// RegisterStatusNotifierHost method async fn register_status_notifier_host( &mut self, service: &str, - #[zbus(header)] hdr: MessageHeader<'_>, + #[zbus(header)] hdr: Header<'_>, #[zbus(connection)] con: &Connection, - #[zbus(signal_context)] ctxt: SignalContext<'_>, + #[zbus(signal_emitter)] signal_emitter: SignalEmitter<'_>, ) -> zbus::fdo::Result<()> { // TODO: right now, we convert everything to the unique bus name (something like :1.234). // However, it might make more sense to listen to the actual name they give us, so that if @@ -55,14 +56,14 @@ impl StatusNotifierWatcher { }; if added_first { - self.is_status_notifier_host_registered_changed(&ctxt) + self.is_status_notifier_host_registered_changed(&signal_emitter) .await?; } - StatusNotifierWatcher::status_notifier_host_registered(&ctxt).await?; + StatusNotifierWatcher::status_notifier_host_registered(&signal_emitter).await?; self.tasks.spawn({ let hosts = self.hosts.clone(); - let ctxt = ctxt.to_owned(); + let signal_emitter = signal_emitter.to_owned(); let con = con.to_owned(); async move { if let Err(e) = wait_for_service_exit(&con, service.as_ref().into()).await { @@ -78,14 +79,16 @@ impl StatusNotifierWatcher { if removed_last { if let Err(e) = - StatusNotifierWatcher::is_status_notifier_host_registered_refresh(&ctxt) - .await + StatusNotifierWatcher::is_status_notifier_host_registered_refresh( + &signal_emitter, + ) + .await { error!("failed to signal Watcher: {}", e); } } if let Err(e) = - StatusNotifierWatcher::status_notifier_host_unregistered(&ctxt).await + StatusNotifierWatcher::status_notifier_host_unregistered(&signal_emitter).await { error!("failed to signal Watcher: {}", e); } @@ -96,15 +99,19 @@ impl StatusNotifierWatcher { } /// StatusNotifierHostRegistered signal. - #[dbus_interface(signal)] - async fn status_notifier_host_registered(ctxt: &SignalContext<'_>) -> zbus::Result<()>; + #[zbus(signal)] + async fn status_notifier_host_registered( + signal_emitter: &SignalEmitter<'_>, + ) -> zbus::Result<()>; /// StatusNotifierHostUnregistered signal - #[dbus_interface(signal)] - async fn status_notifier_host_unregistered(ctxt: &SignalContext<'_>) -> zbus::Result<()>; + #[zbus(signal)] + async fn status_notifier_host_unregistered( + signal_emitter: &SignalEmitter<'_>, + ) -> zbus::Result<()>; /// IsStatusNotifierHostRegistered property - #[dbus_interface(property)] + #[zbus(property)] fn is_status_notifier_host_registered(&self) -> bool { let hosts = self.hosts.lock().expect("mutex lock should succeed"); !hosts.is_empty() @@ -114,9 +121,9 @@ impl StatusNotifierWatcher { async fn register_status_notifier_item( &mut self, service: &str, - #[zbus(header)] hdr: MessageHeader<'_>, + #[zbus(header)] hdr: Header<'_>, #[zbus(connection)] con: &Connection, - #[zbus(signal_context)] ctxt: SignalContext<'_>, + #[zbus(signal_emitter)] signal_emitter: SignalEmitter<'_>, ) -> zbus::fdo::Result<()> { let (service, objpath) = parse_service(service, hdr, con).await?; let service = zbus::names::BusName::Unique(service); @@ -133,12 +140,14 @@ impl StatusNotifierWatcher { } info!("new item: {}", item); - self.registered_status_notifier_items_changed(&ctxt).await?; - StatusNotifierWatcher::status_notifier_item_registered(&ctxt, item.as_ref()).await?; + self.registered_status_notifier_items_changed(&signal_emitter) + .await?; + StatusNotifierWatcher::status_notifier_item_registered(&signal_emitter, item.as_ref()) + .await?; self.tasks.spawn({ let items = self.items.clone(); - let ctxt = ctxt.to_owned(); + let signal_emitter = signal_emitter.to_owned(); let con = con.to_owned(); async move { if let Err(e) = wait_for_service_exit(&con, service.as_ref()).await { @@ -152,13 +161,16 @@ impl StatusNotifierWatcher { } if let Err(e) = - StatusNotifierWatcher::registered_status_notifier_items_refresh(&ctxt).await + StatusNotifierWatcher::registered_status_notifier_items_refresh(&signal_emitter) + .await { error!("failed to signal Watcher: {}", e); } - if let Err(e) = - StatusNotifierWatcher::status_notifier_item_unregistered(&ctxt, item.as_ref()) - .await + if let Err(e) = StatusNotifierWatcher::status_notifier_item_unregistered( + &signal_emitter, + item.as_ref(), + ) + .await { error!("failed to signal Watcher: {}", e); } @@ -171,9 +183,9 @@ impl StatusNotifierWatcher { async fn unregister_status_notifier_item( &mut self, service: &str, - #[zbus(header)] hdr: MessageHeader<'_>, + #[zbus(header)] hdr: Header<'_>, #[zbus(connection)] con: &Connection, - #[zbus(signal_context)] context: SignalContext<'_>, + #[zbus(signal_emitter)] context: SignalEmitter<'_>, ) -> zbus::fdo::Result<()> { debug!("received item unregister: {service}"); @@ -195,28 +207,28 @@ impl StatusNotifierWatcher { } /// StatusNotifierItemRegistered signal - #[dbus_interface(signal)] + #[zbus(signal)] async fn status_notifier_item_registered( - ctxt: &zbus::SignalContext<'_>, + signal_emitter: &SignalEmitter<'_>, service: &str, ) -> zbus::Result<()>; /// StatusNotifierItemUnregistered signal - #[dbus_interface(signal)] + #[zbus(signal)] async fn status_notifier_item_unregistered( - ctxt: &zbus::SignalContext<'_>, + signal_emitter: &SignalEmitter<'_>, service: &str, ) -> zbus::Result<()>; /// RegisteredStatusNotifierItems property - #[dbus_interface(property)] + #[zbus(property)] fn registered_status_notifier_items(&self) -> Vec { let items = self.items.lock().expect("mutex lock should succeed"); items.iter().cloned().collect() } /// ProtocolVersion property - #[dbus_interface(property)] + #[zbus(property)] fn protocol_version(&self) -> i32 { 0 } @@ -251,26 +263,26 @@ impl StatusNotifierWatcher { /// Equivalent to `is_status_notifier_host_registered_invalidate`, but without requiring /// `self`. async fn is_status_notifier_host_registered_refresh( - ctxt: &SignalContext<'_>, + signal_emitter: &SignalEmitter<'_>, ) -> zbus::Result<()> { zbus::fdo::Properties::properties_changed( - ctxt, + signal_emitter, Self::name(), - &std::collections::HashMap::new(), - &["IsStatusNotifierHostRegistered"], + std::collections::HashMap::new(), + Cow::Borrowed(&["IsStatusNotifierHostRegistered"]), ) .await } /// Equivalent to `registered_status_notifier_items_invalidate`, but without requiring `self`. async fn registered_status_notifier_items_refresh( - ctxt: &SignalContext<'_>, + signal_emitter: &SignalEmitter<'_>, ) -> zbus::Result<()> { zbus::fdo::Properties::properties_changed( - ctxt, + signal_emitter, Self::name(), - &std::collections::HashMap::new(), - &["RegisteredStatusNotifierItems"], + std::collections::HashMap::new(), + Cow::Borrowed(&["RegisteredStatusNotifierItems"]), ) .await } @@ -285,12 +297,12 @@ impl StatusNotifierWatcher { /// status items pass non-conforming values. One common one is just the object path. async fn parse_service<'a>( service: &'a str, - hdr: MessageHeader<'_>, + hdr: Header<'_>, con: &Connection, ) -> zbus::fdo::Result<(zbus::names::UniqueName<'static>, &'a str)> { if service.starts_with('/') { // they sent us just the object path - if let Some(sender) = hdr.sender()? { + if let Some(sender) = hdr.sender() { Ok((sender.to_owned(), service)) } else { warn!("unknown sender"); diff --git a/src/item.rs b/src/item.rs index 33b710b..5871fd6 100644 --- a/src/item.rs +++ b/src/item.rs @@ -2,7 +2,7 @@ use crate::dbus::DBusProps; use crate::error::{Error, Result}; use serde::Deserialize; use std::fmt::{Debug, Formatter}; -use zbus::zvariant::{Array, Structure, Value}; +use zbus::zvariant::{Array, Structure}; /// Represents an item to display inside the tray. /// @@ -150,36 +150,27 @@ impl IconPixmap { array .iter() .map(|pixmap| { - let structure = pixmap.downcast_ref::(); - let fields = structure - .ok_or(Error::InvalidData("invalid or missing structure data"))? - .fields(); + let structure = pixmap.downcast_ref::<&Structure>()?; + let fields = structure.fields(); let width = fields .first() - .and_then(Value::downcast_ref::) - .copied() - .ok_or(Error::InvalidData("invalid or missing width"))?; + .ok_or(Error::InvalidData("invalid or missing width"))? + .downcast_ref::()?; let height = fields - .get(1) - .and_then(Value::downcast_ref::) - .copied() - .ok_or(Error::InvalidData("invalid or missing height"))?; + .first() + .ok_or(Error::InvalidData("invalid or missing width"))? + .downcast_ref::()?; let pixel_values = fields .get(2) - .and_then(Value::downcast_ref::) .ok_or(Error::InvalidData("invalid or missing pixel values"))? - .get(); + .downcast_ref::<&Array>()?; let pixels = pixel_values .iter() - .map(|p| { - p.downcast_ref::() - .ok_or(Error::InvalidData("invalid pixel value")) - .copied() - }) + .map(|p| p.downcast_ref::().map_err(Into::into)) .collect::>()?; Ok(IconPixmap { @@ -211,27 +202,28 @@ impl TryFrom<&Structure<'_>> for Tooltip { Ok(Self { icon_name: fields .first() - .and_then(Value::downcast_ref::) - .map(ToString::to_string) - .ok_or(Error::InvalidData("icon_name"))?, + .ok_or(Error::InvalidData("icon_name"))? + .downcast_ref::<&str>() + .map(ToString::to_string)?, icon_data: fields .get(1) - .and_then(Value::downcast_ref::) - .map(IconPixmap::from_array) - .ok_or(Error::InvalidData("icon_data"))??, + .ok_or(Error::InvalidData("icon_data"))? + .downcast_ref::<&Array>() + .map_err(Into::into) + .and_then(IconPixmap::from_array)?, title: fields .get(2) - .and_then(Value::downcast_ref::) - .map(ToString::to_string) - .ok_or(Error::InvalidData("title"))?, + .ok_or(Error::InvalidData("title"))? + .downcast_ref::<&str>() + .map(ToString::to_string)?, description: fields .get(3) - .and_then(Value::downcast_ref::) - .map(ToString::to_string) - .ok_or(Error::InvalidData("description"))?, + .ok_or(Error::InvalidData("description"))? + .downcast_ref::<&str>() + .map(ToString::to_string)?, }) } } @@ -241,23 +233,32 @@ impl TryFrom for StatusNotifierItem { fn try_from(props: DBusProps) -> Result { if let Some(id) = props.get_string("Id") { + let id = id?; Ok(Self { id, - title: props.get_string("Title"), - status: props.get_status(), - window_id: props.get::("WindowId").copied().unwrap_or_default(), - icon_theme_path: props.get_string("IconThemePath"), - icon_name: props.get_string("IconName"), - icon_pixmap: props.get_icon_pixmap("IconPixmap"), - overlay_icon_name: props.get_string("OverlayIconName"), - overlay_icon_pixmap: props.get_icon_pixmap("OverlayIconPixmap"), - attention_icon_name: props.get_string("AttentionIconName"), - attention_icon_pixmap: props.get_icon_pixmap("AttentionIconPixmap"), - attention_movie_name: props.get_string("AttentionMovieName"), - tool_tip: props.get_tooltip()?, - item_is_menu: props.get("ItemIsMenu").copied().unwrap_or_default(), - category: props.get_category(), - menu: props.get_object_path("Menu"), + title: props.get_string("Title").transpose()?, + status: props.get_status()?, + window_id: props + .get::("WindowId") + .transpose()? + .copied() + .unwrap_or_default() as u32, + icon_theme_path: props.get_string("IconThemePath").transpose()?, + icon_name: props.get_string("IconName").transpose()?, + icon_pixmap: props.get_icon_pixmap("IconPixmap").transpose()?, + overlay_icon_name: props.get_string("OverlayIconName").transpose()?, + overlay_icon_pixmap: props.get_icon_pixmap("OverlayIconPixmap").transpose()?, + attention_icon_name: props.get_string("AttentionIconName").transpose()?, + attention_icon_pixmap: props.get_icon_pixmap("AttentionIconPixmap").transpose()?, + attention_movie_name: props.get_string("AttentionMovieName").transpose()?, + tool_tip: props.get_tooltip().transpose()?, + item_is_menu: props + .get("ItemIsMenu") + .transpose()? + .copied() + .unwrap_or_default(), + category: props.get_category()?, + menu: props.get_object_path("Menu").transpose()?, }) } else { Err(Error::MissingProperty("Id")) @@ -266,26 +267,29 @@ impl TryFrom for StatusNotifierItem { } impl DBusProps { - fn get_category(&self) -> Category { - self.get::("Category") + fn get_category(&self) -> Result { + Ok(self + .get::("Category") + .transpose()? .map(Category::from) - .unwrap_or_default() + .unwrap_or_default()) } - fn get_status(&self) -> Status { - self.get::("Status") + fn get_status(&self) -> Result { + Ok(self + .get::("Status") + .transpose()? .map(Status::from) - .unwrap_or_default() + .unwrap_or_default()) } - fn get_icon_pixmap(&self, key: &str) -> Option> { + fn get_icon_pixmap(&self, key: &str) -> Option>> { self.get::(key) - .and_then(|arr| IconPixmap::from_array(arr).ok()) + .map(|arr| arr.and_then(IconPixmap::from_array)) } - fn get_tooltip(&self) -> Result> { + fn get_tooltip(&self) -> Option> { self.get::("ToolTip") - .map(Tooltip::try_from) - .transpose() + .map(|t| t.and_then(Tooltip::try_from)) } } diff --git a/src/menu.rs b/src/menu.rs index 0c510cb..feb77e2 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -2,7 +2,6 @@ use crate::dbus::dbus_menu_proxy::{MenuLayout, PropertiesUpdate, UpdatedProps}; use crate::error::{Error, Result}; use serde::Deserialize; use std::collections::HashMap; -use zbus::zvariant; use zbus::zvariant::{Array, OwnedValue, Structure, Value}; /// A menu that should be displayed when clicking corresponding tray icon @@ -221,9 +220,7 @@ impl TryFrom<&OwnedValue> for MenuItem { type Error = Error; fn try_from(value: &OwnedValue) -> Result { - let structure = value - .downcast_ref::() - .ok_or(Error::ZBusVariant(zvariant::Error::IncorrectType))?; + let structure = value.downcast_ref::<&Structure>()?; let mut fields = structure.fields().iter(); @@ -241,30 +238,30 @@ impl TryFrom<&OwnedValue> for MenuItem { if let Some(Value::Dict(dict)) = fields.next() { menu.children_display = dict - .get::("children-display")? + .get::<&str, &str>(&"children-display")? .map(str::to_string); // see: https://github.com/gnustep/libs-dbuskit/blob/4dc9b56216e46e0e385b976b0605b965509ebbbd/Bundles/DBusMenu/com.canonical.dbusmenu.xml#L76 menu.label = dict - .get::("label")? + .get::<&str, &str>(&"label")? .map(|label| label.replace('_', "")); - if let Some(enabled) = dict.get::("enabled")? { - menu.enabled = *enabled; + if let Some(enabled) = dict.get::<&str, bool>(&"enabled")? { + menu.enabled = enabled; } - if let Some(visible) = dict.get::("visible")? { - menu.visible = *visible; + if let Some(visible) = dict.get::<&str, bool>(&"visible")? { + menu.visible = visible; } - menu.icon_name = dict.get::("icon-name")?.map(str::to_string); + menu.icon_name = dict.get::<&str, &str>(&"icon-name")?.map(str::to_string); - if let Some(array) = dict.get::("icon-data")? { + if let Some(array) = dict.get::<&str, &Array>(&"icon-data")? { menu.icon_data = Some(get_icon_data(array)?); } if let Some(disposition) = dict - .get::("disposition") + .get::<&str, &str>(&"disposition") .ok() .flatten() .map(Disposition::from) @@ -273,21 +270,21 @@ impl TryFrom<&OwnedValue> for MenuItem { } menu.toggle_state = dict - .get::("toggle-state") + .get::<&str, i32>(&"toggle-state") .ok() .flatten() - .map(|value| ToggleState::from(*value)) + .map(ToggleState::from) .unwrap_or_default(); menu.toggle_type = dict - .get::("toggle-type") + .get::<&str, &str>(&"toggle-type") .ok() .flatten() .map(ToggleType::from) .unwrap_or_default(); menu.menu_type = dict - .get::("type") + .get::<&str, &str>(&"type") .ok() .flatten() .map(MenuType::from) @@ -297,7 +294,7 @@ impl TryFrom<&OwnedValue> for MenuItem { if let Some(Value::Array(array)) = fields.next() { let mut submenu = vec![]; for value in array.iter() { - let value = OwnedValue::from(value); + let value = OwnedValue::try_from(value)?; let menu = MenuItem::try_from(&value)?; submenu.push(menu); } @@ -345,42 +342,43 @@ impl TryFrom> for MenuItemUpdate { fn try_from(value: UpdatedProps) -> Result { let dict = value.fields; - let icon_data = - if let Some(arr) = dict.get("icon-data").and_then(Value::downcast_ref::) { - Some(Some(get_icon_data(arr)?)) - } else { - None - }; + let icon_data = if let Some(arr) = dict + .get("icon-data") + .map(Value::downcast_ref::<&Array>) + .transpose()? + { + Some(Some(get_icon_data(arr)?)) + } else { + None + }; Ok(Self { label: dict .get("label") - .map(|v| v.downcast_ref::().map(ToString::to_string)), + .map(|v| v.downcast_ref::<&str>().map(ToString::to_string).ok()), enabled: dict .get("enabled") - .and_then(Value::downcast_ref::) - .copied(), + .and_then(|v| Value::downcast_ref::(v).ok()), visible: dict .get("visible") - .and_then(Value::downcast_ref::) - .copied(), + .and_then(|v| Value::downcast_ref::(v).ok()), icon_name: dict .get("icon-name") - .map(|v| v.downcast_ref::().map(ToString::to_string)), + .map(|v| v.downcast_ref::<&str>().map(ToString::to_string).ok()), icon_data, toggle_state: dict .get("toggle-state") - .and_then(Value::downcast_ref::) - .map(|value| ToggleState::from(*value)), + .and_then(|v| Value::downcast_ref::(v).ok()) + .map(ToggleState::from), disposition: dict .get("disposition") - .and_then(Value::downcast_ref::) + .and_then(|v| Value::downcast_ref::<&str>(v).ok()) .map(Disposition::from), }) } @@ -389,10 +387,6 @@ impl TryFrom> for MenuItemUpdate { fn get_icon_data(array: &Array) -> Result> { array .iter() - .map(|v| { - v.downcast_ref::() - .ok_or(Error::InvalidData("invalid u8")) - .copied() - }) + .map(|v| v.downcast_ref::().map_err(Into::into)) .collect::>>() }