Skip to content

Commit

Permalink
Auto merge of #440 - MichaelMcDonnell:use_std_matches, r=jdm
Browse files Browse the repository at this point in the history
Use std `matches` macro

The custom `matches` macro was added before the standard library version was
added. The standard library `matches` macro was added in Rust 1.42 [1]. The
implementations are slightly different but the documentation is very similar.
Additionally, some of the `_tt_as_expr_hack` uses were no longer used with this
change.

[1] https://doc.rust-lang.org/std/macro.matches.html
  • Loading branch information
bors-servo committed Mar 27, 2022
2 parents 8412575 + 0510f52 commit 429f239
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion html5ever/src/tokenizer/mod.rs
Expand Up @@ -24,7 +24,7 @@ use self::char_ref::{CharRef, CharRefTokenizer};
use crate::util::str::lower_ascii_letter;

use log::{debug, trace};
use mac::{_tt_as_expr_hack, format_if, matches};
use mac::format_if;
use markup5ever::{namespace_url, ns, small_char_set};
use std::borrow::Cow::{self, Borrowed};
use std::collections::BTreeMap;
Expand Down
2 changes: 1 addition & 1 deletion html5ever/src/tree_builder/mod.rs
Expand Up @@ -36,7 +36,7 @@ use crate::tree_builder::tag_sets::*;
use crate::tree_builder::types::*;
use crate::util::str::to_escaped_string;
use log::{debug, log_enabled, warn, Level};
use mac::{_tt_as_expr_hack, format_if, matches};
use mac::{_tt_as_expr_hack, format_if};

pub use self::PushFlag::*;

Expand Down
2 changes: 1 addition & 1 deletion html5ever/src/tree_builder/tag_sets.rs
Expand Up @@ -10,7 +10,7 @@
//! Various sets of HTML tag names, and macros for declaring them.

use crate::ExpandedName;
use mac::{_tt_as_expr_hack, matches};
use mac::_tt_as_expr_hack;
use markup5ever::{expanded_name, local_name, namespace_prefix, namespace_url, ns};

macro_rules! declare_tag_set_impl ( ($param:ident, $b:ident, $supr:ident, $($tag:tt)+) => (
Expand Down
2 changes: 1 addition & 1 deletion xml5ever/src/tree_builder/mod.rs
Expand Up @@ -10,7 +10,7 @@
mod types;

use log::{debug, warn};
use mac::{_tt_as_expr_hack, matches, unwrap_or_return};
use mac::unwrap_or_return;
use markup5ever::{local_name, namespace_prefix, namespace_url, ns};
use std::borrow::Cow;
use std::borrow::Cow::Borrowed;
Expand Down

0 comments on commit 429f239

Please sign in to comment.