Skip to content

Commit

Permalink
use string_data
Browse files Browse the repository at this point in the history
  • Loading branch information
janstarke committed Feb 19, 2024
1 parent 7a9b0a2 commit 25f93ba
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/bin/lnk2bodyfile/lnk_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 25f93ba

Please sign in to comment.