-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eww-git: patch to comply with rust-lang/rfcs#2140
- Loading branch information
1 parent
49cabff
commit 496d5b4
Showing
4 changed files
with
70 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
!/.SRCINFO | ||
!/PKGBUILD | ||
!/eww-git.install | ||
!/0001-comply-with-rust-lang-rfcs-2140.patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
From 2bb7084425994bf70a69ee52f5917dd3fa1185ba Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?=C3=A9clairevoyant?= | ||
<848000+eclairevoyant@users.noreply.github.com> | ||
Date: Fri, 23 Jun 2023 09:21:29 -0400 | ||
Subject: [PATCH] comply with rust-lang/rfcs#2140 | ||
|
||
--- | ||
crates/eww/src/error_handling_ctx.rs | 2 +- | ||
crates/eww/src/main.rs | 4 ++-- | ||
crates/eww/src/widgets/widget_definitions.rs | 2 +- | ||
3 files changed, 4 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/crates/eww/src/error_handling_ctx.rs b/crates/eww/src/error_handling_ctx.rs | ||
index 3273200..8a57e35 100644 | ||
--- a/crates/eww/src/error_handling_ctx.rs | ||
+++ b/crates/eww/src/error_handling_ctx.rs | ||
@@ -53,7 +53,7 @@ pub fn anyhow_err_to_diagnostic(err: &anyhow::Error) -> Option<Diagnostic<usize> | ||
} | ||
|
||
pub fn stringify_diagnostic(mut diagnostic: codespan_reporting::diagnostic::Diagnostic<usize>) -> anyhow::Result<String> { | ||
- diagnostic.labels.drain_filter(|label| Span(label.range.start, label.range.end, label.file_id).is_dummy()); | ||
+ diagnostic.labels.extract_if(|label| Span(label.range.start, label.range.end, label.file_id).is_dummy()); | ||
|
||
let mut config = term::Config::default(); | ||
let mut chars = Chars::box_drawing(); | ||
diff --git a/crates/eww/src/main.rs b/crates/eww/src/main.rs | ||
index 1e61c3b..9211d03 100644 | ||
--- a/crates/eww/src/main.rs | ||
+++ b/crates/eww/src/main.rs | ||
@@ -1,9 +1,9 @@ | ||
#![feature(trace_macros)] | ||
-#![feature(drain_filter)] | ||
+#![feature(extract_if)] | ||
#![feature(box_patterns)] | ||
#![feature(slice_concat_trait)] | ||
#![feature(try_blocks)] | ||
-#![feature(hash_drain_filter)] | ||
+#![feature(hash_extract_if)] | ||
#![allow(rustdoc::private_intra_doc_links)] | ||
|
||
extern crate gtk; | ||
diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs | ||
index 2cdc907..a142940 100644 | ||
--- a/crates/eww/src/widgets/widget_definitions.rs | ||
+++ b/crates/eww/src/widgets/widget_definitions.rs | ||
@@ -127,7 +127,7 @@ static DEPRECATED_ATTRS: Lazy<HashSet<&str>> = | ||
/// @desc these properties apply to _all_ widgets, and can be used anywhere! | ||
pub(super) fn resolve_widget_attrs(bargs: &mut BuilderArgs, gtk_widget: >k::Widget) -> Result<()> { | ||
let deprecated: HashSet<_> = DEPRECATED_ATTRS.to_owned(); | ||
- let contained_deprecated: Vec<_> = bargs.unhandled_attrs.drain_filter(|a, _| deprecated.contains(&a.0 as &str)).collect(); | ||
+ let contained_deprecated: Vec<_> = bargs.unhandled_attrs.extract_if(|a, _| deprecated.contains(&a.0 as &str)).collect(); | ||
if !contained_deprecated.is_empty() { | ||
let diag = error_handling_ctx::stringify_diagnostic(gen_diagnostic! { | ||
kind = Severity::Error, | ||
-- | ||
2.41.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters