diff --git a/CHANGELOG.md b/CHANGELOG.md index 94d85cbf..279b9cbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## [Unreleased] +- Remove `AsRef` restriction from `PreEscaped` + [#377](https://github.com/lambda-fairy/maud/pull/377) + ## [0.25.0] - 2023-04-16 - Remove `html_debug!` diff --git a/docs/content/render-trait.md b/docs/content/render-trait.md index 2f536ff4..11e3dadf 100644 --- a/docs/content/render-trait.md +++ b/docs/content/render-trait.md @@ -64,7 +64,7 @@ use maud::{Markup, PreEscaped, Render}; use pulldown_cmark::{Parser, html}; /// Renders a block of Markdown using `pulldown-cmark`. -struct Markdown>(T); +struct Markdown(T); impl> Render for Markdown { fn render(&self) -> Markup { diff --git a/maud/src/lib.rs b/maud/src/lib.rs index 5dd74d0a..1b8c494f 100644 --- a/maud/src/lib.rs +++ b/maud/src/lib.rs @@ -215,7 +215,7 @@ pub fn display(value: impl Display) -> impl Render { /// A wrapper that renders the inner value without escaping. #[derive(Debug, Clone, Copy)] -pub struct PreEscaped>(pub T); +pub struct PreEscaped(pub T); impl> Render for PreEscaped { fn render_to(&self, w: &mut String) { @@ -228,20 +228,20 @@ impl> Render for PreEscaped { /// The `html!` macro expands to an expression of this type. pub type Markup = PreEscaped; -impl + Into> PreEscaped { +impl> PreEscaped { /// Converts the inner value to a string. pub fn into_string(self) -> String { self.0.into() } } -impl + Into> From> for String { +impl> From> for String { fn from(value: PreEscaped) -> String { value.into_string() } } -impl + Default> Default for PreEscaped { +impl Default for PreEscaped { fn default() -> Self { Self(Default::default()) }