trying to make windows pathbuf conversion work

This commit is contained in:
NA 2024-01-25 17:20:29 +00:00
parent 7b8a9ab2df
commit 141f9c59f4

View file

@ -2,8 +2,11 @@ use std::{fs::OpenOptions, io::Write, path::PathBuf, process::exit};
use chrono::prelude::Local; use chrono::prelude::Local;
use clap::Args; use clap::Args;
#[cfg(target_os = "windows")]
use path_slash::PathBufExt as _;
use url::Url; use url::Url;
mod book; mod book;
mod html; mod html;
mod http; 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 { fn convert_path_to_windows(path: PathBuf) -> PathBuf {
// If target os is windows. // If target os is windows.
#[cfg(target_os = "windows")] { #[cfg(target_os = "windows")] {
use path_slash::PathBufExt as _;
return PathBuf::from_slash(path); return PathBuf::from_slash(path);
} }