summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2019-10-13 13:09:03 +0200
committerLaurenz <laurmaedje@gmail.com>2019-10-13 13:09:39 +0200
commit5c04185892947969005ffcf6412d7190dafb3a79 (patch)
treefeef0dcb373261e44a31242584635f11c6cc1701 /src/bin
parente2d17aa9d9491b339e6200c97b52f7ade51fa1d8 (diff)
Reformat some things 🧺
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/main.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bin/main.rs b/src/bin/main.rs
index b678cda9..5ae20f4a 100644
--- a/src/bin/main.rs
+++ b/src/bin/main.rs
@@ -29,7 +29,9 @@ fn run() -> Result<(), Box<dyn Error>> {
// Compute the output filename from the input filename by replacing the extension.
let dest_path = if args.len() <= 2 {
let stem = source_path.file_stem().ok_or_else(|| "missing destation file name")?;
+
let base = source_path.parent().ok_or_else(|| "missing destation folder")?;
+
base.join(format!("{}.pdf", stem.to_string_lossy()))
} else {
PathBuf::from(&args[2])