Skip to content

Commit

Permalink
feat: remove unneeded associated constant
Browse files Browse the repository at this point in the history
  • Loading branch information
vidhanio committed Sep 6, 2023
1 parent 3e6ff8a commit a3b204c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ resolver = "2"
license = "MIT"
readme = "README.md"
repository = "https://github.com/vidhanio/html-node"
version = "0.2.3"
version = "0.3.0"
File renamed without changes.
6 changes: 1 addition & 5 deletions html-node-core/src/typed/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ use crate::{Element, Node};

/// A typed HTML element.
pub trait TypedElement: Default {
/// The name of the element.
const NAME: &'static str;

/// The attributes of the element.
type Attributes: TypedAttributes;

Expand Down Expand Up @@ -101,7 +98,6 @@ macro_rules! typed_element {
}

impl $crate::typed::TypedElement for $ElementName {
const NAME: &'static str = $crate::typed_element!(@NAME_STR $ElementName$(($name))?);
type Attributes = $crate::typed_attributes!(@NAME ($ElementName) $([$AttributeName])?);

fn from_attributes(
Expand All @@ -116,7 +112,7 @@ macro_rules! typed_element {
attributes.append(&mut self.other_attributes);

$crate::Element {
name: Self::NAME.into(),
name: ::std::convert::From::from($crate::typed_element!(@NAME_STR $ElementName$(($name))?)),
attributes,
children,
}
Expand Down
4 changes: 2 additions & 2 deletions html-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ name = "typed_custom_attributes"
required-features = ["typed"]

[dependencies]
html-node-core = { version = "0.2", path = "../html-node-core" }
html-node-macro = { version = "0.2", path = "../html-node-macro" }
html-node-core = { version = "0.3", path = "../html-node-core" }
html-node-macro = { version = "0.3", path = "../html-node-macro" }


[dev-dependencies]
Expand Down

0 comments on commit a3b204c

Please sign in to comment.