From 141f9c59f49c1e497343051bb95dab895f51fb6e Mon Sep 17 00:00:00 2001 From: NA Date: Thu, 25 Jan 2024 17:20:29 +0000 Subject: [PATCH] trying to make windows pathbuf conversion work --- src/library.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/library.rs b/src/library.rs index 0c09fca..d176238 100644 --- a/src/library.rs +++ b/src/library.rs @@ -2,8 +2,11 @@ use std::{fs::OpenOptions, io::Write, path::PathBuf, process::exit}; use chrono::prelude::Local; use clap::Args; +#[cfg(target_os = "windows")] +use path_slash::PathBufExt as _; use url::Url; + mod book; mod html; mod http; @@ -123,8 +126,6 @@ pub fn generate_markdown(markdown_args: MarkdownArgs, book_url: Url, output_dire fn convert_path_to_windows(path: PathBuf) -> PathBuf { // If target os is windows. #[cfg(target_os = "windows")] { - use path_slash::PathBufExt as _; - return PathBuf::from_slash(path); }