From c8472c50dc184b5295c31e96a69cff482742de3a Mon Sep 17 00:00:00 2001 From: RGBCube Date: Thu, 4 Jan 2024 08:21:33 +0300 Subject: [PATCH] Don't canoncicalize --- embed/src/dir.rs | 9 ++------- macros/src/lib.rs | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/embed/src/dir.rs b/embed/src/dir.rs index 2730ecb..9301fcf 100644 --- a/embed/src/dir.rs +++ b/embed/src/dir.rs @@ -42,10 +42,7 @@ fn read_dir(path: &PathBuf) -> Vec { let entry = entry.expect("Failed to read entry"); let filetype = entry.file_type().expect("Failed to read entry filetype"); - let path = entry - .path() - .canonicalize() - .expect("Failed to get the canonical path of the DirEntry"); + let path = entry.path(); if filetype.is_dir() { let children = read_dir(&path); @@ -62,9 +59,7 @@ fn read_dir(path: &PathBuf) -> Vec { } pub fn __include_dir(path: &str) -> Dir { - let path = PathBuf::from(path) - .canonicalize() - .expect("Failed to get the canonical path of the DirEntry"); + let path = PathBuf::from(path); let children = read_dir(&path); diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 0e2d06d..22cd623 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -15,9 +15,7 @@ use syn::{ pub fn __include_dir(tokens: pm1::TokenStream) -> pm1::TokenStream { let path = parse_macro_input!(tokens as LitStr).value(); - let path = PathBuf::from(path) - .canonicalize() - .expect("Failed to get the canonical path of the DirEntry"); + let path = PathBuf::from(path); let path_str = path .to_str() @@ -43,10 +41,7 @@ fn read_dir(path: &PathBuf) -> Vec { for entry in fs::read_dir(path).expect("Failed to list directory contents") { let entry = entry.expect("Failed to read entry"); - let path = entry - .path() - .canonicalize() - .expect("Failed to get the canonical path of the DirEntry"); + let path = entry.path(); let path_str = path .to_str()