chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7111437
)
Html type: impl Default and derive new()
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Wed, 30 Mar 2022 23:36:09 +0000
(
00:36
+0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Wed, 30 Mar 2022 23:59:17 +0000
(
00:59
+0100)
Default suggested by clippy.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
base/html.rs
patch
|
blob
|
history
diff --git
a/base/html.rs
b/base/html.rs
index 4af4d2b48e27fb0d02974f5ca008a51f0103de93..7f8f7b22e5505b85302a4dbaa95aefdf8bd43c1d 100644
(file)
--- a/
base/html.rs
+++ b/
base/html.rs
@@
-4,7
+4,7
@@
use crate::prelude::*;
-#[derive(Clone,Serialize,Deserialize,Hash,Eq,Ord,PartialEq,PartialOrd)]
+#[derive(Clone,Serialize,De
fault,De
serialize,Hash,Eq,Ord,PartialEq,PartialOrd)]
#[serde(transparent)]
pub struct Html(String);
@@
-83,7
+83,7
@@
impl<'e, T:Display+'e> HtmlFormat<'e> for IsHtmlFormatted<T> {
}
impl Html {
- pub fn new() -> Self {
Html(String::new()
) }
+ pub fn new() -> Self {
default(
) }
pub fn from_txt(s: &str) -> Self {
Html(htmlescape::encode_minimal(&s))
}