From a91ab9007e9d86d9ca075a8608849d2de255ce8b Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Fri, 28 Feb 2020 01:01:31 -0500 Subject: [PATCH] Rename Token method `equals_symbol` to `is_symbol` --- src/args.rs | 2 +- src/lib.rs | 6 +++--- src/style.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/args.rs b/src/args.rs index b19fb86..1497d33 100644 --- a/src/args.rs +++ b/src/args.rs @@ -143,7 +143,7 @@ pub(crate) fn eat_call_args>( TokenKind::Variable(_) => { let v = toks.next().unwrap(); devour_whitespace_or_comment(toks); - if toks.next().unwrap().equals_symbol(Symbol::Colon) { + if toks.next().unwrap().is_symbol(Symbol::Colon) { name = v.kind.to_string(); } else { val.push(v); diff --git a/src/lib.rs b/src/lib.rs index 8f5a5b7..3d7310c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -97,8 +97,8 @@ pub(crate) struct Token { } impl Token { - pub fn equals_symbol(&self, s: Symbol) -> bool { - self.kind.equals_symbol(s) + pub fn is_symbol(&self, s: Symbol) -> bool { + self.kind.is_symbol(s) } pub fn from_string(s: String) -> Self { @@ -168,7 +168,7 @@ pub(crate) enum TokenKind { } impl TokenKind { - pub fn equals_symbol(&self, s: Symbol) -> bool { + pub fn is_symbol(&self, s: Symbol) -> bool { self == &TokenKind::Symbol(s) } } diff --git a/src/style.rs b/src/style.rs index 16787ce..c934ccf 100644 --- a/src/style.rs +++ b/src/style.rs @@ -136,7 +136,7 @@ impl<'a> StyleParser<'a> { loop { let property = self.parse_property(toks, super_property.clone())?; if let Some(tok) = toks.peek() { - if tok.equals_symbol(Symbol::OpenCurlyBrace) { + if tok.is_symbol(Symbol::OpenCurlyBrace) { match self.eat_style_group(toks, property, scope)? { Expr::Styles(s) => styles.extend(s), Expr::Style(s) => styles.push(*s), @@ -144,7 +144,7 @@ impl<'a> StyleParser<'a> { } devour_whitespace(toks); if let Some(tok) = toks.peek() { - if tok.equals_symbol(Symbol::CloseCurlyBrace) { + if tok.is_symbol(Symbol::CloseCurlyBrace) { toks.next(); devour_whitespace(toks); return Ok(Expr::Styles(styles));