Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Dec 5, 2022
1 parent ae5fe6e commit 7462bb6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
10 changes: 4 additions & 6 deletions crates/tailwind-parse/src/eval/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,7 @@ pub fn rounded(
Some(SubjectValue::Value(Value(v))) => {
simple_lookup(&theme.border_radius, v, "borderRadius")
}
Some(SubjectValue::Css(Css(v))) => {
Some(to_lit(&[("borderRadius", &v.to_string())]))
}
Some(SubjectValue::Css(Css(v))) => Some(to_lit(&[("borderRadius", v)])),
None => simple_lookup(&theme.border_radius, "DEFAULT", "borderRadius"),
}
}
Expand Down Expand Up @@ -323,7 +321,7 @@ pub fn text(Value(rest): &Value, theme: &TailwindTheme) -> Option<ObjectLit> {
.or_else(|| simple_lookup(&theme.colors, rest, "color"))
.or_else(|| {
["left", "center", "right", "justify", "start", "end"]
.contains(&rest)
.contains(rest)
.then_some(to_lit(&[("textAlign", rest)]))
})
}
Expand Down Expand Up @@ -863,14 +861,14 @@ pub fn box_(Value(rest): &Value, _theme: &TailwindTheme) -> Option<ObjectLit> {

pub fn select(Value(rest): &Value, _theme: &TailwindTheme) -> Option<ObjectLit> {
["none", "text", "all", "auto"]
.contains(&rest)
.contains(rest)
.then_some(to_lit(&[("userSelect", rest)]))
}

pub fn overflow(Value(rest): &Value, _theme: &TailwindTheme) -> Option<ObjectLit> {
let values = ["auto", "hidden", "clip", "visible", "scroll"];
values
.contains(&rest)
.contains(rest)
.then_some(to_lit(&[("overflow", rest)]))
.or_else(|| match rest.split_once('-') {
Some(("x", rest)) => values
Expand Down
4 changes: 2 additions & 2 deletions crates/tailwind-parse/src/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use nom::{
bytes::complete::take_while1,
character::{
complete::{char, space0},
is_alphabetic, is_alphanumeric,
is_alphanumeric,
},
combinator::{opt, verify},
combinator::opt,
multi::many0,
sequence::{preceded, terminated},
IResult, Parser,
Expand Down
1 change: 0 additions & 1 deletion crates/tailwind-parse/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ mod plugin {
use crate::NomSpan;
use nom::{
bytes::complete::{tag, take_while1},
combinator::map_res,
error::Error,
sequence::preceded,
IResult, Slice,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ impl<'a> VisitMut for TransformVisitor<'a> {
.note("when evaluating plugin")
.emit()
});
return None;
None
}
}
};
Expand Down

0 comments on commit 7462bb6

Please sign in to comment.