1
Fork 0

use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into()

This commit is contained in:
Matthias Krüger 2018-08-23 10:14:52 +02:00
parent e73077e106
commit ede1f7d2a5
87 changed files with 133 additions and 133 deletions

View file

@ -156,13 +156,13 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
root_path = page.root_path,
suffix=page.resource_suffix)
} else {
"".to_owned()
String::new()
},
content = *t,
root_path = page.root_path,
css_class = page.css_class,
logo = if layout.logo.is_empty() {
"".to_string()
String::new()
} else {
format!("<a href='{}{}/index.html'>\
<img src='{}' alt='logo' width='100'></a>",
@ -173,7 +173,7 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
description = page.description,
keywords = page.keywords,
favicon = if layout.favicon.is_empty() {
"".to_string()
String::new()
} else {
format!(r#"<link rel="shortcut icon" href="{}">"#, layout.favicon)
},