From: Ian Jackson Date: Sun, 17 Apr 2022 23:05:13 +0000 (+0100) Subject: impl Default for &HtmlStr X-Git-Tag: otter-1.1.0~497 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5e33d590e3db0b325f017dd313e438e6bbb149ac;p=otter.git impl Default for &HtmlStr We'll use this in a moment. Signed-off-by: Ian Jackson --- 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) } }