diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2019-04-23 15:26:56 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2019-04-23 15:51:52 +0200 |
commit | 612a21368cc1a9f2a85edf9fcf305819c33780e6 (patch) | |
tree | 16098436d99d6bec1a18c02f09dcfe8fa401bff3 | |
parent | 365219e5b2e4d98021c61587b0f49e67adc5c925 (diff) |
Refactor: Do not use the `format!("{}", ...)` trick
-rw-r--r-- | src/frontend/list.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/frontend/list.rs b/src/frontend/list.rs index cf5a946..0ebd41b 100644 --- a/src/frontend/list.rs +++ b/src/frontend/list.rs @@ -23,17 +23,17 @@ impl Frontend for ListFrontend { packages.iter().fold(Ok(()), |accu, package| { accu.and_then(|_| { - let status = if let Some(stat) = package.status() { - format!("{}", stat) + let status: &String = if let Some(stat) = package.status() { + stat.deref() as &String } else { - String::from("No status") + &String::from("No status") }; // not optimal, but works for now. - let url = if let Some(url) = package.www() { + let url: &String = if let Some(url) = package.www() { if let Some(url) = url.first() { - format!("{}", url.deref()) + url.deref() as &String } else { - String::from("") + &String::from("") } } else { String::from("") |