rust(lint): remove useless format calls

In these simple cases to_string() is recommended and likely
performs better as the formatter is not called.
pull/6304/head
Jason Ish 5 years ago committed by Victor Julien
parent 5bf5de3350
commit 8bb6dab69d

@ -29,7 +29,7 @@ fn add_attributes(transform: &Vec<SaAttribute>, js: &mut JsonBuilder) -> Result<
for attribute in transform { for attribute in transform {
js.set_string( js.set_string(
attribute.attribute_type.to_string().as_str(), attribute.attribute_type.to_string().as_str(),
format!("{}", attribute.attribute_value.to_string()).as_str(), attribute.attribute_value.to_string().as_str(),
)?; )?;
if let Some(numeric_value) = attribute.numeric_value { if let Some(numeric_value) = attribute.numeric_value {

@ -35,7 +35,7 @@ fn krb5_log_response(jsb: &mut JsonBuilder, tx: &mut KRB5Transaction) -> Result<
None => "<empty>".to_owned(), None => "<empty>".to_owned(),
}; };
let realm = match tx.realm { let realm = match tx.realm {
Some(ref x) => format!("{}", x.0), Some(ref x) => x.0.to_string(),
None => "<empty>".to_owned(), None => "<empty>".to_owned(),
}; };
let sname = match tx.sname { let sname = match tx.sname {

Loading…
Cancel
Save