From 25f93bad36a134fe5032362a23df4a0bc90cff8c Mon Sep 17 00:00:00 2001 From: Jan Starke Date: Mon, 19 Feb 2024 10:24:44 +0100 Subject: [PATCH] use string_data --- src/bin/lnk2bodyfile/lnk_file.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/bin/lnk2bodyfile/lnk_file.rs b/src/bin/lnk2bodyfile/lnk_file.rs index 536cc11..31b5e1f 100644 --- a/src/bin/lnk2bodyfile/lnk_file.rs +++ b/src/bin/lnk2bodyfile/lnk_file.rs @@ -17,18 +17,15 @@ impl LnkFile { fn print_bodyfile_for_me(&self) { let header = self.lnk_file.header(); let localpath = self.lnk_file.link_target().unwrap_or("-".to_string()); - let arguments = match self.lnk_file.arguments() { - Some(s) => s, - None => "-", - }; + let atime = ShellLinkHeader::access_time(header); let mtime = ShellLinkHeader::write_time(header); let crtime = ShellLinkHeader::creation_time(header); let bfline = Bodyfile3Line::new() .with_name(&format!( - "{} {} (referred to by \"{}\")", - localpath, arguments, self.file_name + "{} ({}, referred to by \"{}\")", + localpath, self.lnk_file.string_data(), self.file_name, )) .with_size((*ShellLinkHeader::file_size(header)).into()) .with_crtime(crtime.datetime().into())