Skip to content

Commit

Permalink
implement EscapeAttribute for &str
Browse files Browse the repository at this point in the history
  • Loading branch information
Pitasi committed Oct 1, 2023
1 parent 16ab24a commit 5ce4b6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ exclude = [
]

[workspace.package]
version = "0.1.10"
version = "0.1.11"

[workspace.dependencies]
rscx = { path = "./rscx", version = "0.1.10" }
rscx-macros = { path = "./rscx-macros", version = "0.1.10" }
rscx = { path = "./rscx", version = "0.1.11" }
rscx-macros = { path = "./rscx-macros", version = "0.1.11" }
6 changes: 6 additions & 0 deletions rscx/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ pub trait EscapeAttribute {
fn escape_attribute(&self) -> Cow<str>;
}

impl EscapeAttribute for &str {
fn escape_attribute(&self) -> Cow<str> {
encode_unquoted_attribute(self)
}
}

impl EscapeAttribute for str {
fn escape_attribute(&self) -> Cow<str> {
encode_unquoted_attribute(self)
Expand Down

0 comments on commit 5ce4b6a

Please sign in to comment.