Skip to content

Commit

Permalink
comply with rust-lang/rfcs#2140
Browse files Browse the repository at this point in the history
  • Loading branch information
eclairevoyant committed Jul 15, 2023
1 parent 25e50ed commit fc2db6f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/eww/src/error_handling_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.retain(|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();
Expand Down
4 changes: 2 additions & 2 deletions crates/eww/src/main.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion crates/eww/src/widgets/widget_definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: &gtk::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,
Expand Down

0 comments on commit fc2db6f

Please sign in to comment.