do not allocate empty strings

follow review from @pwoolcoc, and do not use

    SafeString::new(&<String>::new())

since this makes an allocation which will then just be thrown away.
Instead, we pass ""
This commit is contained in:
Igor Galić
2018-09-14 18:24:27 +02:00
parent f5c299f23c
commit 65e213309b
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -143,8 +143,8 @@ impl Blog {
name: inst.clone(),
local: false,
// We don't really care about all the following for remote instances
long_description: SafeString::new(&<String>::new()),
short_description: SafeString::new(&<String>::new()),
long_description: SafeString::new(""),
short_description: SafeString::new(""),
default_license: String::new(),
open_registrations: true,
short_description_html: String::new(),
+2 -2
View File
@@ -205,8 +205,8 @@ impl User {
public_domain: inst.clone(),
local: false,
// We don't really care about all the following for remote instances
long_description: SafeString::new(&<String>::new()),
short_description: SafeString::new(&<String>::new()),
long_description: SafeString::new(""),
short_description: SafeString::new(""),
default_license: String::new(),
open_registrations: true,
short_description_html: String::new(),