guix/gnu/packages/patches/fragments-unchain-if-let.patch
Liliana Marie Prikler bfdf5a0fec
gnu: Add fragments.
* gnu/packages/patches/fragments-unchain-if-let.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it here.
* gnu/packages/gnome-circle.scm (fragments): New variable.
* gnu/packages/rust-crates.scm (rust-ashpd-0.11.0, rust-magnet-uri-0.2.1)
(rust-oo7-0.4.3, rust-proc-macro2-1.0.105, rust-schemars-1.2.0)
(rust-serde-json-1.0.149, rust-serde-spanned-1.0.4, rust-serde-with-3.16.1)
(rust-serde-with-macros-3.16.1, rust-smol-2.0.2, rust-uuid-1.19.0)
(rust-zmij-1.0.14): New variables.
(lookup-cargo-inputs): Add ‘fragments’.
2026-01-24 09:32:58 +01:00

45 lines
1.6 KiB
Diff

This syntax requires Rust >= 1.88.0,
see <https://github.com/rust-lang/rust/issues/53667>.
diff --git a/src/app.rs b/src/app.rs
index 04aa571..3169994 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -399,11 +399,13 @@ mod imp {
debug!("Add torrent by file: {file:?}");
if let Some(ext) = file.extension()
- && ext != "torrent"
{
- warn!("Unsupported file extension: {ext:?}");
- utils::inapp_notification(&i18n("Unsupported file format"), gtk::Widget::NONE);
- return;
+ if (ext != "torrent")
+ {
+ warn!("Unsupported file extension: {ext:?}");
+ utils::inapp_notification(&i18n("Unsupported file format"), gtk::Widget::NONE);
+ return;
+ }
}
let fut = clone!(
diff --git a/src/ui/window.rs b/src/ui/window.rs
index 063d276..8c6c2ff 100644
--- a/src/ui/window.rs
+++ b/src/ui/window.rs
@@ -377,9 +377,11 @@ mod imp {
// Try finding the exact torrent file name
if let Some(mut segments) = torrent_link.path_segments()
- && let Some(last) = segments.next_back()
{
- msg = i18n_f("Add “{}” from clipboard?", &[last])
+ if let Some(last) = segments.next_back()
+ {
+ msg = i18n_f("Add “{}” from clipboard?", &[last])
+ }
}
let toast = adw::Toast::new(&msg);
toast.set_timeout(0);
--
2.52.0