Skip to content

Commit

Permalink
apply code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
teymour-aldridge committed Jul 16, 2021
1 parent 75e6b08 commit d46598e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/yew-macro/src/html_tree/lint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,13 @@ impl Lint for AHrefLint {
};
if let Some(prop) = get_attribute(&element.props, "href") {
if let syn::Expr::Lit(lit) = &prop.value {
if let syn::Lit::Str(str) = &lit.lit {
if str.value() == "#" {
if let syn::Lit::Str(href) = &lit.lit {
if href.value() == "#" {
emit_warning!(
lit.span(),
"'#' is not a suitable value for the `href` attribute. \
Without a meaningful attribute assistive technologies \
will struggle to understand your webpage. (hint: use a \
tag other than `<a>` here or `javascript:void(0)` for \
the `href` attribute)"
will struggle to understand your webpage."
)
}
}
Expand Down

0 comments on commit d46598e

Please sign in to comment.