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); }