1
Fork 0
mirror of https://github.com/RGBCube/embd-rs synced 2025-07-29 06:27:44 +00:00

Don't canoncicalize

This commit is contained in:
RGBCube 2024-01-04 08:21:33 +03:00
parent 58a1fa2182
commit c8472c50dc
No known key found for this signature in database
2 changed files with 4 additions and 14 deletions

View file

@ -42,10 +42,7 @@ fn read_dir(path: &PathBuf) -> Vec<DirEntry> {
let entry = entry.expect("Failed to read entry"); let entry = entry.expect("Failed to read entry");
let filetype = entry.file_type().expect("Failed to read entry filetype"); let filetype = entry.file_type().expect("Failed to read entry filetype");
let path = entry let path = entry.path();
.path()
.canonicalize()
.expect("Failed to get the canonical path of the DirEntry");
if filetype.is_dir() { if filetype.is_dir() {
let children = read_dir(&path); let children = read_dir(&path);
@ -62,9 +59,7 @@ fn read_dir(path: &PathBuf) -> Vec<DirEntry> {
} }
pub fn __include_dir(path: &str) -> Dir { pub fn __include_dir(path: &str) -> Dir {
let path = PathBuf::from(path) let path = PathBuf::from(path);
.canonicalize()
.expect("Failed to get the canonical path of the DirEntry");
let children = read_dir(&path); let children = read_dir(&path);

View file

@ -15,9 +15,7 @@ use syn::{
pub fn __include_dir(tokens: pm1::TokenStream) -> pm1::TokenStream { pub fn __include_dir(tokens: pm1::TokenStream) -> pm1::TokenStream {
let path = parse_macro_input!(tokens as LitStr).value(); let path = parse_macro_input!(tokens as LitStr).value();
let path = PathBuf::from(path) let path = PathBuf::from(path);
.canonicalize()
.expect("Failed to get the canonical path of the DirEntry");
let path_str = path let path_str = path
.to_str() .to_str()
@ -43,10 +41,7 @@ fn read_dir(path: &PathBuf) -> Vec<TokenStream> {
for entry in fs::read_dir(path).expect("Failed to list directory contents") { for entry in fs::read_dir(path).expect("Failed to list directory contents") {
let entry = entry.expect("Failed to read entry"); let entry = entry.expect("Failed to read entry");
let path = entry let path = entry.path();
.path()
.canonicalize()
.expect("Failed to get the canonical path of the DirEntry");
let path_str = path let path_str = path
.to_str() .to_str()