From 5e33d590e3db0b325f017dd313e438e6bbb149ac Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 18 Apr 2022 00:05:13 +0100 Subject: [PATCH] impl Default for &HtmlStr We'll use this in a moment. Signed-off-by: Ian Jackson --- base/html.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/base/html.rs b/base/html.rs index 146bd106..85a8f521 100644 --- a/base/html.rs +++ b/base/html.rs @@ -52,6 +52,10 @@ pub struct HtmlStr(str); #[serde(transparent)] pub struct HtmlLit(&'static str); +impl Default for &'static HtmlStr { + fn default() -> Self { HtmlStr::from_html_str("") } +} + impl From for &'static HtmlStr { fn from(l: HtmlLit) -> &'static HtmlStr { HtmlStr::from_html_str(l.0) } } -- 2.30.2