diff options
| author | Fuwn <[email protected]> | 2022-08-16 19:03:22 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-08-16 19:03:22 -0700 |
| commit | 7c5662db552b9c4e8a1578eb917047980511ccc3 (patch) | |
| tree | 66904d8af52d2e84aa44df800a81e39c75007eb8 /src/xml.rs | |
| parent | fix(main.rs): github actions build error (diff) | |
| download | locus-7c5662db552b9c4e8a1578eb917047980511ccc3.tar.xz locus-7c5662db552b9c4e8a1578eb917047980511ccc3.zip | |
fix: bump toolchain for github actions
Diffstat (limited to 'src/xml.rs')
| -rw-r--r-- | src/xml.rs | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -16,7 +16,10 @@ // Copyright (C) 2022-2022 Fuwn <[email protected]> // SPDX-License-Identifier: GPL-3.0-only -use std::{collections::HashMap, fmt::Display}; +use std::{ + collections::HashMap, + fmt::{Display, Write}, +}; pub struct Item { fields: HashMap<String, String>, @@ -40,7 +43,8 @@ impl Display for Item { f, "<item>{}</item>", self.fields.iter().fold(String::new(), |mut acc, (k, v)| { - acc.push_str(&format!("<{}>{}</{}>", k, v, k)); + let _ = write!(acc, "<{}>{}</{}>", k, v, k); + acc }) ) @@ -88,7 +92,8 @@ impl Display for Writer { version=\"2.0\"><channel>{}<atom:link href=\"{}\" rel=\"self\" \ type=\"application/rss+xml\" />{}</channel></rss>", self.fields.iter().fold(String::new(), |mut acc, (k, v)| { - acc.push_str(&format!("<{}>{}</{}>", k, v, k)); + let _ = write!(acc, "<{}>{}</{}>", k, v, k); + acc }), self.link, |