Use inline format arguments

This commit is contained in:
Dirkjan Ochtman 2023-02-27 10:17:26 +01:00
parent c4684a526f
commit 6b2b9d1a7f
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ pub(crate) const SUCCESS_MSG: &str = "Command completed successfully";
pub(crate) fn get_xml(path: &str) -> Result<String, Box<dyn Error>> { pub(crate) fn get_xml(path: &str) -> Result<String, Box<dyn Error>> {
let ws_regex = Regex::new(r"[\s]{2,}")?; let ws_regex = Regex::new(r"[\s]{2,}")?;
let mut f = File::open(format!("{}/{}", RESOURCES_DIR, path))?; let mut f = File::open(format!("{RESOURCES_DIR}/{path}"))?;
let mut buf = String::new(); let mut buf = String::new();
f.read_to_string(&mut buf)?; f.read_to_string(&mut buf)?;

View File

@ -47,7 +47,7 @@ fn xml(path: &str) -> String {
let ws_regex = Regex::new(r"[\s]{2,}").unwrap(); let ws_regex = Regex::new(r"[\s]{2,}").unwrap();
let end_regex = Regex::new(r"\?>").unwrap(); let end_regex = Regex::new(r"\?>").unwrap();
let mut f = File::open(format!("tests/resources/{}", path)).unwrap(); let mut f = File::open(format!("tests/resources/{path}")).unwrap();
let mut buf = String::new(); let mut buf = String::new();
f.read_to_string(&mut buf).unwrap(); f.read_to_string(&mut buf).unwrap();