From 42d6328d82706129c2671746c223e1ab85609b3e Mon Sep 17 00:00:00 2001 From: reya Date: Tue, 25 Mar 2025 20:53:22 +0700 Subject: [PATCH] chore: update gpui --- Cargo.lock | 223 +++++++++++++----------- Cargo.toml | 6 +- crates/account/Cargo.toml | 4 +- crates/account/src/lib.rs | 36 ++-- crates/app/Cargo.toml | 4 +- crates/app/src/chat_space.rs | 2 +- crates/app/src/main.rs | 2 +- crates/app/src/views/chat.rs | 32 ++-- crates/app/src/views/contacts.rs | 2 +- crates/app/src/views/login.rs | 2 +- crates/app/src/views/new_account.rs | 2 +- crates/app/src/views/profile.rs | 8 +- crates/app/src/views/relays.rs | 19 +- crates/app/src/views/sidebar/compose.rs | 25 +-- crates/chats/Cargo.toml | 4 +- crates/chats/src/lib.rs | 13 +- crates/chats/src/room.rs | 8 +- crates/common/Cargo.toml | 4 +- crates/global/Cargo.toml | 4 +- crates/ui/Cargo.toml | 4 +- crates/ui/src/clipboard.rs | 3 +- crates/ui/src/dock_area/mod.rs | 16 +- crates/ui/src/dock_area/tab_panel.rs | 10 +- crates/ui/src/input/blink_cursor.rs | 8 +- crates/ui/src/list/list.rs | 6 +- crates/ui/src/notification.rs | 6 +- crates/ui/src/switch.rs | 3 +- rust-toolchain.toml | 10 ++ 28 files changed, 255 insertions(+), 211 deletions(-) create mode 100644 rust-toolchain.toml diff --git a/Cargo.lock b/Cargo.lock index 6144faa..ce1f723 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -775,9 +775,9 @@ dependencies = [ [[package]] name = "bytemuck_derive" -version = "1.9.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d35fadd3de6c82a550b136427123552b401efdab9859130f1cf485fbdea40af" +checksum = "2ff22c2722516255d1823ce3cc4bc0b154dbc9364be5c905d6baa6eccbbc8774" dependencies = [ "proc-macro2", "quote", @@ -857,9 +857,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.16" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "jobserver", "libc", @@ -1108,7 +1108,7 @@ dependencies = [ [[package]] name = "collections" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#68a572873b2ee2dc6fc34894754b2083d7c2262f" +source = "git+https://github.com/zed-industries/zed#d9dcc5933449f37143fa38f8c91ee9b30960457b" dependencies = [ "indexmap", "rustc-hash 2.1.1", @@ -1312,17 +1312,18 @@ dependencies = [ [[package]] name = "cosmic-text" -version = "0.11.2" -source = "git+https://github.com/pop-os/cosmic-text?rev=542b20c#542b20ca4376a3b5de5fa629db1a4ace44e18e0c" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e418dd4f5128c3e93eab12246391c54a20c496811131f85754dc8152ee207892" dependencies = [ "bitflags 2.9.0", - "fontdb 0.18.0", + "fontdb 0.16.2", "log", "rangemap", - "rayon", "rustc-hash 1.1.0", "rustybuzz 0.14.1", "self_cell", + "smol_str", "swash", "sys-locale", "ttf-parser 0.21.1", @@ -1474,7 +1475,7 @@ dependencies = [ [[package]] name = "derive_refineable" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#68a572873b2ee2dc6fc34894754b2083d7c2262f" +source = "git+https://github.com/zed-industries/zed#d9dcc5933449f37143fa38f8c91ee9b30960457b" dependencies = [ "proc-macro2", "quote", @@ -1861,9 +1862,9 @@ dependencies = [ [[package]] name = "font-types" -version = "0.7.3" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3971f9a5ca983419cdc386941ba3b9e1feba01a0ab888adf78739feb2798492" +checksum = "d868ec188a98bb014c606072edd47e52e7ab7297db943b0b28503121e1d037bd" dependencies = [ "bytemuck", ] @@ -1879,16 +1880,16 @@ dependencies = [ [[package]] name = "fontdb" -version = "0.18.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e32eac81c1135c1df01d4e6d4233c47ba11f6a6d07f33e0bba09d18797077770" +checksum = "b0299020c3ef3f60f526a4f64ab4a3d4ce116b1acbf24cdd22da0068e5d81dc3" dependencies = [ "fontconfig-parser", "log", "memmap2", "slotmap", "tinyvec", - "ttf-parser 0.21.1", + "ttf-parser 0.20.0", ] [[package]] @@ -2234,7 +2235,7 @@ dependencies = [ [[package]] name = "gpui" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#68a572873b2ee2dc6fc34894754b2083d7c2262f" +source = "git+https://github.com/zed-industries/zed#d9dcc5933449f37143fa38f8c91ee9b30960457b" dependencies = [ "anyhow", "as-raw-xcb-connection", @@ -2300,7 +2301,7 @@ dependencies = [ "strum", "sum_tree", "taffy", - "thiserror 1.0.69", + "thiserror 2.0.12", "usvg", "util", "uuid", @@ -2311,7 +2312,8 @@ dependencies = [ "wayland-protocols", "wayland-protocols-plasma", "windows", - "windows-core 0.60.1", + "windows-core 0.61.0", + "windows-numerics", "x11-clipboard", "x11rb", "xim", @@ -2321,7 +2323,7 @@ dependencies = [ [[package]] name = "gpui_macros" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#68a572873b2ee2dc6fc34894754b2083d7c2262f" +source = "git+https://github.com/zed-industries/zed#d9dcc5933449f37143fa38f8c91ee9b30960457b" dependencies = [ "proc-macro2", "quote", @@ -2544,7 +2546,7 @@ dependencies = [ [[package]] name = "http_client" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#68a572873b2ee2dc6fc34894754b2083d7c2262f" +source = "git+https://github.com/zed-industries/zed#d9dcc5933449f37143fa38f8c91ee9b30960457b" dependencies = [ "anyhow", "bytes", @@ -2560,7 +2562,7 @@ dependencies = [ [[package]] name = "http_client_tls" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#68a572873b2ee2dc6fc34894754b2083d7c2262f" +source = "git+https://github.com/zed-industries/zed#d9dcc5933449f37143fa38f8c91ee9b30960457b" dependencies = [ "rustls", "rustls-platform-verifier", @@ -2632,14 +2634,15 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core 0.52.0", ] @@ -2794,9 +2797,9 @@ dependencies = [ [[package]] name = "image" -version = "0.25.5" +version = "0.25.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" +checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" dependencies = [ "bytemuck", "byteorder-lite", @@ -3152,9 +3155,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" dependencies = [ "serde", "value-bag", @@ -3265,7 +3268,7 @@ dependencies = [ [[package]] name = "media" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#68a572873b2ee2dc6fc34894754b2083d7c2262f" +source = "git+https://github.com/zed-industries/zed#d9dcc5933449f37143fa38f8c91ee9b30960457b" dependencies = [ "anyhow", "bindgen 0.70.1", @@ -3444,7 +3447,7 @@ checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" [[package]] name = "nostr" version = "0.40.0" -source = "git+https://github.com/rust-nostr/nostr#942d0b07844071188ce81fa70ffac7c7d389c15a" +source = "git+https://github.com/rust-nostr/nostr#b513d781b55ec90b367ce58a0d91ead4e92242e7" dependencies = [ "aes", "base64", @@ -3469,7 +3472,7 @@ dependencies = [ [[package]] name = "nostr-connect" version = "0.40.0" -source = "git+https://github.com/rust-nostr/nostr#942d0b07844071188ce81fa70ffac7c7d389c15a" +source = "git+https://github.com/rust-nostr/nostr#b513d781b55ec90b367ce58a0d91ead4e92242e7" dependencies = [ "async-utility", "nostr", @@ -3481,7 +3484,7 @@ dependencies = [ [[package]] name = "nostr-database" version = "0.40.0" -source = "git+https://github.com/rust-nostr/nostr#942d0b07844071188ce81fa70ffac7c7d389c15a" +source = "git+https://github.com/rust-nostr/nostr#b513d781b55ec90b367ce58a0d91ead4e92242e7" dependencies = [ "flatbuffers", "lru", @@ -3492,7 +3495,7 @@ dependencies = [ [[package]] name = "nostr-lmdb" version = "0.40.0" -source = "git+https://github.com/rust-nostr/nostr#942d0b07844071188ce81fa70ffac7c7d389c15a" +source = "git+https://github.com/rust-nostr/nostr#b513d781b55ec90b367ce58a0d91ead4e92242e7" dependencies = [ "async-utility", "heed", @@ -3505,7 +3508,7 @@ dependencies = [ [[package]] name = "nostr-relay-pool" version = "0.40.0" -source = "git+https://github.com/rust-nostr/nostr#942d0b07844071188ce81fa70ffac7c7d389c15a" +source = "git+https://github.com/rust-nostr/nostr#b513d781b55ec90b367ce58a0d91ead4e92242e7" dependencies = [ "async-utility", "async-wsocket", @@ -3522,7 +3525,7 @@ dependencies = [ [[package]] name = "nostr-sdk" version = "0.40.0" -source = "git+https://github.com/rust-nostr/nostr#942d0b07844071188ce81fa70ffac7c7d389c15a" +source = "git+https://github.com/rust-nostr/nostr#b513d781b55ec90b367ce58a0d91ead4e92242e7" dependencies = [ "async-utility", "nostr", @@ -3890,9 +3893,9 @@ checksum = "b4ce411919553d3f9fa53a0880544cda985a112117a0444d5ff1e870a893d6ea" [[package]] name = "oo7" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c84df357c7049f98c8b157abe71ee751531166c14ba09366e08bc6ab1ea2c9" +checksum = "6cb23d3ec3527d65a83be1c1795cb883c52cfa57147d42acc797127df56fc489" dependencies = [ "aes", "ashpd", @@ -4230,7 +4233,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.23", + "zerocopy 0.8.24", ] [[package]] @@ -4363,9 +4366,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" +checksum = "541d0f57c6ec747a90738a52741d3221f7960e8ac2f0ff4b1a63680e033b4ab5" dependencies = [ "cfg_aliases 0.2.1", "libc", @@ -4409,7 +4412,7 @@ checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", - "zerocopy 0.8.23", + "zerocopy 0.8.24", ] [[package]] @@ -4563,9 +4566,9 @@ dependencies = [ [[package]] name = "read-fonts" -version = "0.22.7" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69aacb76b5c29acfb7f90155d39759a29496aebb49395830e928a9703d2eec2f" +checksum = "f6f9e8a4f503e5c8750e4cd3b32a4e090035c46374b305a15c70bad833dca05f" dependencies = [ "bytemuck", "font-types", @@ -4594,7 +4597,7 @@ dependencies = [ [[package]] name = "refineable" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#68a572873b2ee2dc6fc34894754b2083d7c2262f" +source = "git+https://github.com/zed-industries/zed#d9dcc5933449f37143fa38f8c91ee9b30960457b" dependencies = [ "derive_refineable", ] @@ -4723,7 +4726,7 @@ dependencies = [ [[package]] name = "reqwest_client" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#68a572873b2ee2dc6fc34894754b2083d7c2262f" +source = "git+https://github.com/zed-industries/zed#d9dcc5933449f37143fa38f8c91ee9b30960457b" dependencies = [ "anyhow", "bytes", @@ -5135,7 +5138,7 @@ checksum = "c2fdfc24bc566f839a2da4c4295b82db7d25a24253867d5c64355abb5799bdbe" [[package]] name = "semantic_version" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#68a572873b2ee2dc6fc34894754b2083d7c2262f" +source = "git+https://github.com/zed-industries/zed#d9dcc5933449f37143fa38f8c91ee9b30960457b" dependencies = [ "anyhow", "serde", @@ -5316,9 +5319,9 @@ checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "skrifa" -version = "0.22.3" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1c44ad1f6c5bdd4eefed8326711b7dbda9ea45dfd36068c427d332aa382cbe" +checksum = "8cc1aa86c26dbb1b63875a7180aa0819709b33348eb5b1491e4321fae388179d" dependencies = [ "bytemuck", "read-fonts", @@ -5365,6 +5368,12 @@ dependencies = [ "futures-lite 2.6.0", ] +[[package]] +name = "smol_str" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" + [[package]] name = "socket2" version = "0.5.8" @@ -5451,7 +5460,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "sum_tree" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#68a572873b2ee2dc6fc34894754b2083d7c2262f" +source = "git+https://github.com/zed-industries/zed#d9dcc5933449f37143fa38f8c91ee9b30960457b" dependencies = [ "arrayvec", "log", @@ -5460,15 +5469,15 @@ dependencies = [ [[package]] name = "sval" -version = "2.14.0" +version = "2.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c2f18f53c889ec3dfe1c08b20fd51406d09b14bf18b366416718763ccff05a" +checksum = "7cc9739f56c5d0c44a5ed45473ec868af02eb896af8c05f616673a31e1d1bb09" [[package]] name = "sval_buffer" -version = "2.14.0" +version = "2.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8cb1bb48d0bed828b908e6b99e7ab8c7244994dc27948a2e31d42e8c4d77c1" +checksum = "f39b07436a8c271b34dad5070c634d1d3d76d6776e938ee97b4a66a5e8003d0b" dependencies = [ "sval", "sval_ref", @@ -5476,18 +5485,18 @@ dependencies = [ [[package]] name = "sval_dynamic" -version = "2.14.0" +version = "2.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba574872d4ad653071a9db76c49656082db83a37cd5f559874273d36b4a02b9d" +checksum = "ffcb072d857431bf885580dacecf05ed987bac931230736739a79051dbf3499b" dependencies = [ "sval", ] [[package]] name = "sval_fmt" -version = "2.14.0" +version = "2.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "944450b2dbbf8aae98537776b399b23d72b19243ee42522cfd110305f3c9ba5a" +checksum = "3f214f427ad94a553e5ca5514c95c6be84667cbc5568cce957f03f3477d03d5c" dependencies = [ "itoa", "ryu", @@ -5496,9 +5505,9 @@ dependencies = [ [[package]] name = "sval_json" -version = "2.14.0" +version = "2.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "411bbd543c413796ccfbaa44f6676e20032b6c69e4996cb6c3e6ef30c79b96d1" +checksum = "389ed34b32e638dec9a99c8ac92d0aa1220d40041026b625474c2b6a4d6f4feb" dependencies = [ "itoa", "ryu", @@ -5507,9 +5516,9 @@ dependencies = [ [[package]] name = "sval_nested" -version = "2.14.0" +version = "2.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30582d2a90869b380f8260559138c1b68ac3e0765520959f22a1a1fdca31769" +checksum = "14bae8fcb2f24fee2c42c1f19037707f7c9a29a0cda936d2188d48a961c4bb2a" dependencies = [ "sval", "sval_buffer", @@ -5518,18 +5527,18 @@ dependencies = [ [[package]] name = "sval_ref" -version = "2.14.0" +version = "2.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "762d3fbf3c0869064b7c93808c67ad2ed0292dde9b060ac282817941d4707dff" +checksum = "2a4eaea3821d3046dcba81d4b8489421da42961889902342691fb7eab491d79e" dependencies = [ "sval", ] [[package]] name = "sval_serde" -version = "2.14.0" +version = "2.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "752d307438c6a6a3d095a2fecf6950cfb946d301a5bd6b57f047db4f6f8d97b9" +checksum = "172dd4aa8cb3b45c8ac8f3b4111d644cd26938b0643ede8f93070812b87fb339" dependencies = [ "serde", "sval", @@ -5554,9 +5563,9 @@ dependencies = [ [[package]] name = "swash" -version = "0.1.19" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbd59f3f359ddd2c95af4758c18270eddd9c730dde98598023cdabff472c2ca2" +checksum = "13d5bbc2aa266907ed8ee977c9c9e16363cc2b001266104e13397b57f1d15f71" dependencies = [ "skrifa", "yazi", @@ -5684,9 +5693,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" +checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" dependencies = [ "fastrand 2.3.0", "getrandom 0.3.2", @@ -6049,6 +6058,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "ttf-parser" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" + [[package]] name = "ttf-parser" version = "0.21.1" @@ -6307,7 +6322,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "util" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#68a572873b2ee2dc6fc34894754b2083d7c2262f" +source = "git+https://github.com/zed-industries/zed#d9dcc5933449f37143fa38f8c91ee9b30960457b" dependencies = [ "anyhow", "async-fs", @@ -6699,9 +6714,9 @@ dependencies = [ [[package]] name = "whoami" -version = "1.5.2" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" +checksum = "6994d13118ab492c3c80c1f81928718159254c53c472bf9ce36f8dae4add02a7" dependencies = [ "redox_syscall", "wasite", @@ -6741,12 +6756,12 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.60.0" +version = "0.61.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf874e74c7a99773e62b1c671427abf01a425e77c3d3fb9fb1e4883ea934529" +checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419" dependencies = [ "windows-collections", - "windows-core 0.60.1", + "windows-core 0.61.0", "windows-future", "windows-link", "windows-numerics", @@ -6754,11 +6769,11 @@ dependencies = [ [[package]] name = "windows-collections" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5467f79cc1ba3f52ebb2ed41dbb459b8e7db636cc3429458d9a852e15bc24dec" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" dependencies = [ - "windows-core 0.60.1", + "windows-core 0.61.0", ] [[package]] @@ -6772,32 +6787,32 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.60.1" +version = "0.61.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca21a92a9cae9bf4ccae5cf8368dce0837100ddf6e6d57936749e85f152f6247" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" dependencies = [ "windows-implement", "windows-interface", "windows-link", "windows-result 0.3.2", - "windows-strings 0.3.1", + "windows-strings 0.4.0", ] [[package]] name = "windows-future" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a787db4595e7eb80239b74ce8babfb1363d8e343ab072f2ffe901400c03349f0" +checksum = "7a1d6bbefcb7b60acd19828e1bc965da6fcf18a7e39490c5f8be71e54a19ba32" dependencies = [ - "windows-core 0.60.1", + "windows-core 0.61.0", "windows-link", ] [[package]] name = "windows-implement" -version = "0.59.0" +version = "0.60.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ "proc-macro2", "quote", @@ -6823,11 +6838,11 @@ checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" [[package]] name = "windows-numerics" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005dea54e2f6499f2cee279b8f703b3cf3b5734a2d8d21867c8f44003182eeed" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" dependencies = [ - "windows-core 0.60.1", + "windows-core 0.61.0", "windows-link", ] @@ -6890,6 +6905,15 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-strings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -7293,8 +7317,9 @@ dependencies = [ [[package]] name = "xkbcommon" -version = "0.7.0" -source = "git+https://github.com/ConradIrwin/xkbcommon-rs?rev=fcbb4612185cc129ceeff51d22f7fb51810a03b2#fcbb4612185cc129ceeff51d22f7fb51810a03b2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d66ca9352cbd4eecbbc40871d8a11b4ac8107cfc528a6e14d7c19c69d0e1ac9" dependencies = [ "as-raw-xcb-connection", "libc", @@ -7316,9 +7341,9 @@ checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" [[package]] name = "yazi" -version = "0.1.6" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1" +checksum = "e01738255b5a16e78bbb83e7fbba0a1e7dd506905cfc53f4622d89015a03fbb5" [[package]] name = "yeslogic-fontconfig-sys" @@ -7420,9 +7445,9 @@ dependencies = [ [[package]] name = "zeno" -version = "0.2.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd15f8e0dbb966fd9245e7498c7e9e5055d9e5c8b676b95bd67091cd11a1e697" +checksum = "cc0de2315dc13d00e5df3cd6b8d2124a6eaec6a2d4b6a1c5f37b7efad17fcc17" [[package]] name = "zerocopy" @@ -7435,11 +7460,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "zerocopy-derive 0.8.23", + "zerocopy-derive 0.8.24", ] [[package]] @@ -7455,9 +7480,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 732d90c..1299537 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,11 @@ [workspace] +resolver = "2" members = ["crates/*"] default-members = ["crates/app"] -resolver = "2" + +[workspace.package] +publish = false +edition = "2021" [workspace.dependencies] coop = { path = "crates/*" } diff --git a/crates/account/Cargo.toml b/crates/account/Cargo.toml index ad9cff7..9ce40a7 100644 --- a/crates/account/Cargo.toml +++ b/crates/account/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "account" version = "0.0.0" -edition = "2021" -publish = false +edition.workspace = true +publish.workspace = true [dependencies] ui = { path = "../ui" } diff --git a/crates/account/src/lib.rs b/crates/account/src/lib.rs index 3113a55..98e0549 100644 --- a/crates/account/src/lib.rs +++ b/crates/account/src/lib.rs @@ -54,24 +54,22 @@ impl Account { Ok(NostrProfile::new(public_key, metadata)) }); - cx.spawn_in(window, |this, mut cx| async move { - match task.await { - Ok(profile) => { - cx.update(|_, cx| { - this.update(cx, |this, cx| { - this.profile = Some(profile); - this.subscribe(cx); - cx.notify(); - }) + cx.spawn_in(window, async move |this, cx| match task.await { + Ok(profile) => { + cx.update(|_, cx| { + this.update(cx, |this, cx| { + this.profile = Some(profile); + this.subscribe(cx); + cx.notify(); }) - .ok(); - } - Err(e) => { - cx.update(|window, cx| { - window.push_notification(Notification::error(e.to_string()), cx) - }) - .ok(); - } + }) + .ok(); + } + Err(e) => { + cx.update(|window, cx| { + window.push_notification(Notification::error(e.to_string()), cx) + }) + .ok(); } }) .detach(); @@ -91,7 +89,7 @@ impl Account { Ok(NostrProfile::new(public_key, metadata)) }); - cx.spawn_in(window, |this, mut cx| async move { + cx.spawn_in(window, async move |this, cx| { if let Ok(profile) = task.await { cx.update(|_, cx| { this.update(cx, |this, cx| { @@ -156,7 +154,7 @@ impl Account { Ok(()) }); - cx.spawn(|_, _| async move { + cx.spawn(async move |_, _| { if let Err(e) = task.await { log::error!("Error: {}", e); } diff --git a/crates/app/Cargo.toml b/crates/app/Cargo.toml index 4b73ad8..2da481d 100644 --- a/crates/app/Cargo.toml +++ b/crates/app/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "coop" version = "0.1.4" -edition = "2021" -publish = false +edition.workspace = true +publish.workspace = true [[bin]] name = "coop" diff --git a/crates/app/src/chat_space.rs b/crates/app/src/chat_space.rs index 4868d48..0f8c63a 100644 --- a/crates/app/src/chat_space.rs +++ b/crates/app/src/chat_space.rs @@ -283,7 +283,7 @@ impl ChatSpace { Ok(()) }); - cx.spawn_in(window, |_, mut cx| async move { + cx.spawn_in(window, async move |_, cx| { if reset.await.is_ok() { cx.update(|_, cx| { Account::global(cx).update(cx, |this, cx| { diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index 7a0709f..c745618 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -219,7 +219,7 @@ fn main() { // Initialize account state account::init(cx); // Spawn a task to handle events from nostr channel - cx.spawn_in(window, |_, mut cx| async move { + cx.spawn_in(window, async move |_, cx| { let chats = cx.update(|_, cx| ChatRegistry::global(cx)).unwrap(); while let Ok(signal) = event_rx.recv().await { diff --git a/crates/app/src/views/chat.rs b/crates/app/src/views/chat.rs index 2b03dd4..97fec07 100644 --- a/crates/app/src/views/chat.rs +++ b/crates/app/src/views/chat.rs @@ -188,9 +188,9 @@ impl Chat { let room = model.read(cx); let task = room.verify_inbox_relays(cx); - cx.spawn(|this, cx| async move { + cx.spawn(async move |this, cx| { if let Ok(result) = task.await { - _ = cx.update(|cx| { + cx.update(|cx| { _ = this.update(cx, |this, cx| { result.into_iter().for_each(|item| { if !item.1 { @@ -205,7 +205,8 @@ impl Chat { } }); }); - }); + }) + .ok(); } }) .detach(); @@ -219,13 +220,15 @@ impl Chat { let room = model.read(cx); let task = room.load_messages(cx); - cx.spawn(|this, cx| async move { + cx.spawn(async move |this, cx| { if let Ok(events) = task.await { - _ = cx.update(|cx| { - _ = this.update(cx, |this, cx| { + cx.update(|cx| { + this.update(cx, |this, cx| { this.push_messages(events, cx); - }); + }) + .ok(); }) + .ok(); } }) .detach(); @@ -352,12 +355,11 @@ impl Chat { let room = model.read(cx); let task = room.send_message(content, cx); - let window_handle = window.window_handle(); - cx.spawn(|this, mut cx| async move { + cx.spawn_in(window, async move |this, cx| { if let Ok(msgs) = task.await { - _ = cx.update_window(window_handle, |_, window, cx| { - _ = this.update(cx, |this, cx| { + cx.update(|window, cx| { + this.update(cx, |this, cx| { // Reset message input cx.update_entity(&this.input, |this, cx| { this.set_loading(false, window, cx); @@ -365,7 +367,8 @@ impl Chat { this.set_text("", window, cx); cx.notify(); }); - }); + }) + .ok(); for item in msgs.into_iter() { window.push_notification( @@ -373,7 +376,8 @@ impl Chat { cx, ); } - }); + }) + .ok(); } }) .detach(); @@ -392,7 +396,7 @@ impl Chat { self.set_loading(true, cx); // TODO: support multiple upload - cx.spawn(move |this, mut cx| async move { + cx.spawn(async move |this, cx| { match Flatten::flatten(paths.await.map_err(|e| e.into())) { Ok(Some(mut paths)) => { let path = paths.pop().unwrap(); diff --git a/crates/app/src/views/contacts.rs b/crates/app/src/views/contacts.rs index 72f859e..14fb63f 100644 --- a/crates/app/src/views/contacts.rs +++ b/crates/app/src/views/contacts.rs @@ -33,7 +33,7 @@ impl Contacts { let contacts = cx.new(|_| None); let async_contact = contacts.clone(); - cx.spawn(|mut cx| async move { + cx.spawn(async move |cx| { let client = get_client(); let (tx, rx) = oneshot::channel::>(); diff --git a/crates/app/src/views/login.rs b/crates/app/src/views/login.rs index 3342c78..e28bb29 100644 --- a/crates/app/src/views/login.rs +++ b/crates/app/src/views/login.rs @@ -115,7 +115,7 @@ impl Login { }), ); - cx.spawn(|this, cx| async move { + cx.spawn(async move |this, cx| { cx.background_executor() .timer(Duration::from_millis(500)) .await; diff --git a/crates/app/src/views/new_account.rs b/crates/app/src/views/new_account.rs index bcd08fc..78afedb 100644 --- a/crates/app/src/views/new_account.rs +++ b/crates/app/src/views/new_account.rs @@ -122,7 +122,7 @@ impl NewAccount { self.set_uploading(true, cx); - cx.spawn_in(window, |this, mut cx| async move { + cx.spawn_in(window, async move |this, cx| { match Flatten::flatten(paths.await.map_err(|e| e.into())) { Ok(Some(mut paths)) => { let Some(path) = paths.pop() else { diff --git a/crates/app/src/views/profile.rs b/crates/app/src/views/profile.rs index 4709b62..b657fdc 100644 --- a/crates/app/src/views/profile.rs +++ b/crates/app/src/views/profile.rs @@ -78,8 +78,8 @@ impl Profile { focus_handle: cx.focus_handle(), }; - let client = get_client(); let task: Task, Error>> = cx.background_spawn(async move { + let client = get_client(); let signer = client.signer().await?; let public_key = signer.get_public_key().await?; let metadata = client @@ -89,7 +89,7 @@ impl Profile { Ok(metadata) }); - cx.spawn(|this, mut cx| async move { + cx.spawn(async move |this, cx| { if let Ok(Some(metadata)) = task.await { _ = cx.update_window(window_handle, |_, window, cx| { _ = this.update(cx, |this: &mut Profile, cx| { @@ -137,7 +137,7 @@ impl Profile { // Show loading spinner self.set_loading(true, cx); - cx.spawn(move |this, mut cx| async move { + cx.spawn(async move |this, cx| { match Flatten::flatten(paths.await.map_err(|e| e.into())) { Ok(Some(mut paths)) => { let path = paths.pop().unwrap(); @@ -218,7 +218,7 @@ impl Profile { let window_handle = window.window_handle(); - cx.spawn(|this, mut cx| async move { + cx.spawn(async move |this, cx| { let client = get_client(); let (tx, rx) = oneshot::channel::(); diff --git a/crates/app/src/views/relays.rs b/crates/app/src/views/relays.rs index 9b98d41..99d0003 100644 --- a/crates/app/src/views/relays.rs +++ b/crates/app/src/views/relays.rs @@ -65,14 +65,16 @@ impl Relays { } }); - cx.spawn(|this, cx| async move { + cx.spawn(async move |this, cx| { if let Ok(relays) = task.await { - _ = cx.update(|cx| { - _ = this.update(cx, |this: &mut Vec, cx| { + cx.update(|cx| { + this.update(cx, |this: &mut Vec, cx| { *this = relays; cx.notify(); - }); - }); + }) + .ok(); + }) + .ok(); } }) .detach(); @@ -170,13 +172,14 @@ impl Relays { Ok(output.val) }); - cx.spawn_in(window, |this, mut cx| async move { + cx.spawn_in(window, async move |this, cx| { if task.await.is_ok() { cx.update(|window, cx| { - _ = this.update(cx, |this, cx| { + this.update(cx, |this, cx| { this.set_loading(false, cx); cx.notify(); - }); + }) + .ok(); window.close_modal(cx); }) diff --git a/crates/app/src/views/sidebar/compose.rs b/crates/app/src/views/sidebar/compose.rs index 84c1802..9dae4e2 100644 --- a/crates/app/src/views/sidebar/compose.rs +++ b/crates/app/src/views/sidebar/compose.rs @@ -95,16 +95,17 @@ impl Compose { }) .detach(); - cx.spawn(|this, cx| async move { + cx.spawn(async move |this, cx| { if let Ok(contacts) = rx.await { - _ = cx.update(|cx| { + cx.update(|cx| { this.update(cx, |this, cx| { this.contacts.update(cx, |this, cx| { this.extend(contacts); cx.notify(); }); }) - }); + }) + .ok(); } }) .detach(); @@ -146,7 +147,6 @@ impl Compose { } let tags = Tags::from_list(tag_list); - let window_handle = window.window_handle(); let event: Task> = cx.background_spawn(async move { let client = get_client(); @@ -162,9 +162,9 @@ impl Compose { Ok(event) }); - cx.spawn(|this, mut cx| async move { + cx.spawn_in(window, async move |this, cx| { if let Ok(event) = event.await { - _ = cx.update_window(window_handle, |_, window, cx| { + cx.update(|window, cx| { // Stop loading spinner this.update(cx, |this, cx| { this.set_submitting(false, cx); @@ -187,7 +187,8 @@ impl Compose { } } }); - }); + }) + .ok(); } }) .detach(); @@ -242,7 +243,7 @@ impl Compose { }) }; - cx.spawn(|this, mut cx| async move { + cx.spawn(async move |this, cx| { match task.await { Ok(profile) => { let public_key = profile.public_key; @@ -308,14 +309,16 @@ impl Compose { }); // Dismiss error after 2 seconds - cx.spawn(|this, cx| async move { + cx.spawn(async move |this, cx| { Timer::after(Duration::from_secs(2)).await; - _ = cx.update(|cx| { + cx.update(|cx| { this.update(cx, |this, cx| { this.set_error(None, cx); }) - }); + .ok(); + }) + .ok(); }) .detach(); } diff --git a/crates/chats/Cargo.toml b/crates/chats/Cargo.toml index 4638685..b75f5dc 100644 --- a/crates/chats/Cargo.toml +++ b/crates/chats/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "chats" version = "0.0.0" -edition = "2021" -publish = false +edition.workspace = true +publish.workspace = true [dependencies] common = { path = "../common" } diff --git a/crates/chats/src/lib.rs b/crates/chats/src/lib.rs index b545269..12dcfa5 100644 --- a/crates/chats/src/lib.rs +++ b/crates/chats/src/lib.rs @@ -73,10 +73,10 @@ impl ChatRegistry { Ok(result) }); - cx.spawn(|this, cx| async move { + cx.spawn(async move |this, cx| { if let Ok(events) = task.await { - _ = cx.update(|cx| { - _ = this.update(cx, |this, cx| { + cx.update(|cx| { + this.update(cx, |this, cx| { if !events.is_empty() { let current_ids = this.current_rooms_ids(cx); let items: Vec> = events @@ -93,7 +93,6 @@ impl ChatRegistry { .collect(); this.is_loading = false; - this.rooms.extend(items); this.rooms .sort_by_key(|room| Reverse(room.read(cx).last_seen())); @@ -102,8 +101,10 @@ impl ChatRegistry { } cx.notify(); - }); - }); + }) + .ok(); + }) + .ok(); } }) .detach(); diff --git a/crates/chats/src/room.rs b/crates/chats/src/room.rs index b086d46..0e62b77 100644 --- a/crates/chats/src/room.rs +++ b/crates/chats/src/room.rs @@ -44,7 +44,7 @@ impl Room { // Create a task for loading metadata let load_metadata = Self::load_metadata(event, cx); - let room = cx.new(|cx| { + cx.new(|cx| { let this = Self { id, last_seen, @@ -52,7 +52,7 @@ impl Room { members: smallvec![], }; - cx.spawn(|this, cx| async move { + cx.spawn(async move |this, cx| { if let Ok(profiles) = load_metadata.await { _ = cx.update(|cx| { _ = this.update(cx, |this: &mut Room, cx| { @@ -82,9 +82,7 @@ impl Room { .detach(); this - }); - - room + }) } pub fn id(&self) -> u64 { diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 52f66e9..ca4eed3 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "common" version = "0.0.0" -edition = "2021" -publish = false +edition.workspace = true +publish.workspace = true [dependencies] global = { path = "../global" } diff --git a/crates/global/Cargo.toml b/crates/global/Cargo.toml index 052062b..46aa9c3 100644 --- a/crates/global/Cargo.toml +++ b/crates/global/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "global" version = "0.0.0" -edition = "2021" -publish = false +edition.workspace = true +publish.workspace = true [dependencies] nostr-sdk.workspace = true diff --git a/crates/ui/Cargo.toml b/crates/ui/Cargo.toml index 1ed95d9..7f7756e 100644 --- a/crates/ui/Cargo.toml +++ b/crates/ui/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "ui" version = "0.0.0" -edition = "2021" -publish = false +edition.workspace = true +publish.workspace = true [dependencies] gpui.workspace = true diff --git a/crates/ui/src/clipboard.rs b/crates/ui/src/clipboard.rs index 99f7361..6efd3f7 100644 --- a/crates/ui/src/clipboard.rs +++ b/crates/ui/src/clipboard.rs @@ -115,9 +115,8 @@ impl Element for Clipboard { *copied.borrow_mut() = true; let copied = copied.clone(); - cx.spawn(|cx| async move { + cx.spawn(async move |cx| { cx.background_executor().timer(Duration::from_secs(2)).await; - *copied.borrow_mut() = false; }) .detach(); diff --git a/crates/ui/src/dock_area/mod.rs b/crates/ui/src/dock_area/mod.rs index 289ffc1..b48b379 100644 --- a/crates/ui/src/dock_area/mod.rs +++ b/crates/ui/src/dock_area/mod.rs @@ -574,8 +574,8 @@ impl DockArea { window, move |_, _, event, window, cx| { if let PanelEvent::LayoutChanged = event { - cx.spawn_in(window, |view, mut window| async move { - _ = view.update_in(&mut window, |view, window, cx| { + cx.spawn_in(window, async move |view, window| { + _ = view.update_in(window, |view, window, cx| { view.update_toggle_button_tab_panels(window, cx) }); }) @@ -609,8 +609,8 @@ impl DockArea { move |_, panel, event, window, cx| match event { PanelEvent::ZoomIn => { let panel = panel.clone(); - cx.spawn_in(window, |view, mut window| async move { - _ = view.update_in(&mut window, |view, window, cx| { + cx.spawn_in(window, async move |view, window| { + _ = view.update_in(window, |view, window, cx| { view.set_zoomed_in(panel, window, cx); cx.notify(); }); @@ -618,15 +618,15 @@ impl DockArea { .detach(); } PanelEvent::ZoomOut => cx - .spawn_in(window, |view, mut window| async move { - _ = view.update_in(&mut window, |view, window, cx| { + .spawn_in(window, async move |view, window| { + _ = view.update_in(window, |view, window, cx| { view.set_zoomed_out(window, cx); }); }) .detach(), PanelEvent::LayoutChanged => { - cx.spawn_in(window, |view, mut window| async move { - _ = view.update_in(&mut window, |view, window, cx| { + cx.spawn_in(window, async move |view, window| { + _ = view.update_in(window, |view, window, cx| { view.update_toggle_button_tab_panels(window, cx) }); }) diff --git a/crates/ui/src/dock_area/tab_panel.rs b/crates/ui/src/dock_area/tab_panel.rs index c46a532..8d2e883 100644 --- a/crates/ui/src/dock_area/tab_panel.rs +++ b/crates/ui/src/dock_area/tab_panel.rs @@ -181,7 +181,7 @@ impl TabPanel { self.focus_active_panel(window, cx); // Sync the active state to all panels - cx.spawn(|view, cx| async move { + cx.spawn(async move |view, cx| { _ = cx.update(|cx| { _ = view.update(cx, |view, cx| { if let Some(last_active) = view.panels.get(last_active_ix) { @@ -255,7 +255,7 @@ impl TabPanel { window: &mut Window, cx: &mut Context, ) { - cx.spawn_in(window, |view, mut cx| async move { + cx.spawn_in(window, async move |view, cx| { cx.update(|window, cx| { view.update(cx, |view, cx| { view.will_split_placement = Some(placement); @@ -986,7 +986,7 @@ impl TabPanel { }); } - cx.spawn_in(window, |_, mut cx| async move { + cx.spawn_in(window, async move |_, cx| { cx.update(|window, cx| { tab_panel.update(cx, |view, cx| view.remove_self_if_empty(window, cx)) }) @@ -1021,9 +1021,9 @@ impl TabPanel { self.is_zoomed = !self.is_zoomed; - cx.spawn(|view, cx| { + cx.spawn({ let is_zoomed = self.is_zoomed; - async move { + async move |view, cx| { _ = cx.update(|cx| { _ = view.update(cx, |view, cx| { view.set_zoomed(is_zoomed, cx); diff --git a/crates/ui/src/input/blink_cursor.rs b/crates/ui/src/input/blink_cursor.rs index 97c6fac..c574798 100644 --- a/crates/ui/src/input/blink_cursor.rs +++ b/crates/ui/src/input/blink_cursor.rs @@ -50,10 +50,10 @@ impl BlinkCursor { // Schedule the next blink let epoch = self.next_epoch(); - cx.spawn(|this, mut cx| async move { + cx.spawn(async move |this, cx| { Timer::after(INTERVAL).await; if let Some(this) = this.upgrade() { - this.update(&mut cx, |this, cx| this.blink(epoch, cx)).ok(); + this.update(cx, |this, cx| this.blink(epoch, cx)).ok(); } }) .detach(); @@ -71,11 +71,11 @@ impl BlinkCursor { // delay 500ms to start the blinking let epoch = self.next_epoch(); - cx.spawn(|this, mut cx| async move { + cx.spawn(async move |this, cx| { Timer::after(PAUSE_DELAY).await; if let Some(this) = this.upgrade() { - this.update(&mut cx, |this, cx| { + this.update(cx, |this, cx| { this.paused = false; this.blink(epoch, cx); }) diff --git a/crates/ui/src/list/list.rs b/crates/ui/src/list/list.rs index 593c6c4..882954c 100644 --- a/crates/ui/src/list/list.rs +++ b/crates/ui/src/list/list.rs @@ -266,10 +266,10 @@ where self.set_loading(true, window, cx); let search = self.delegate.perform_search(&text, window, cx); - self._search_task = cx.spawn_in(window, |this, mut window| async move { + self._search_task = cx.spawn_in(window, async move |this, window| { search.await; - _ = this.update_in(&mut window, |this, _, _| { + _ = this.update_in(window, |this, _, _| { this.vertical_scroll_handle .scroll_to_item(0, ScrollStrategy::Top); this.last_query = Some(text); @@ -277,7 +277,7 @@ where // Always wait 100ms to avoid flicker Timer::after(Duration::from_millis(100)).await; - _ = this.update_in(&mut window, |this, window, cx| { + _ = this.update_in(window, |this, window, cx| { this.set_loading(false, window, cx); }); }); diff --git a/crates/ui/src/notification.rs b/crates/ui/src/notification.rs index 719f020..244f4c2 100644 --- a/crates/ui/src/notification.rs +++ b/crates/ui/src/notification.rs @@ -193,7 +193,7 @@ impl Notification { cx.notify(); // Dismiss the notification after 0.15s to show the animation. - cx.spawn(|view, cx| async move { + cx.spawn(async move |view, cx| { Timer::after(Duration::from_secs_f32(0.15)).await; cx.update(|cx| { if let Some(view) = view.upgrade() { @@ -339,9 +339,9 @@ impl NotificationList { self.notifications.push_back(notification.clone()); if autohide { // Sleep for 3 seconds to autohide the notification - cx.spawn_in(window, |_, mut cx| async move { + cx.spawn_in(window, async move |_, cx| { Timer::after(Duration::from_secs(3)).await; - _ = notification.update_in(&mut cx, |note, window, cx| { + _ = notification.update_in(cx, |note, window, cx| { note.dismiss(&ClickEvent::default(), window, cx) }); }) diff --git a/crates/ui/src/switch.rs b/crates/ui/src/switch.rs index 3f36aea..5de5c9c 100644 --- a/crates/ui/src/switch.rs +++ b/crates/ui/src/switch.rs @@ -164,9 +164,8 @@ impl Element for Switch { .map_or(false, |prev| prev != checked) { let dur = Duration::from_secs_f64(0.15); - cx.spawn(|cx| async move { + cx.spawn(async move |cx| { cx.background_executor().timer(dur).await; - *prev_checked.borrow_mut() = Some(checked); }) .detach(); diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..d2f1b1c --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,10 @@ +[toolchain] +channel = "1.85" +profile = "minimal" +components = ["rustfmt", "clippy"] +targets = [ + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "x86_64-unknown-linux-gnu", + "x86_64-pc-windows-msvc", +]