From 62757b59ea6a66668661ed54d9bb961d754f58e1 Mon Sep 17 00:00:00 2001 From: Andrew Hayzen Date: Fri, 6 Sep 2024 13:09:07 +0100 Subject: [PATCH] cxx-qt-build: use full directory path when comparing qml roots --- crates/cxx-qt-build/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/cxx-qt-build/src/lib.rs b/crates/cxx-qt-build/src/lib.rs index 1f06141e8..f75386c45 100644 --- a/crates/cxx-qt-build/src/lib.rs +++ b/crates/cxx-qt-build/src/lib.rs @@ -774,12 +774,12 @@ impl CxxQtBuilder { .rust_files .iter() .map(|file| { - file.parent() - .unwrap() - .file_name() - .unwrap() - .to_string_lossy() - .to_string() + if let Some(parent) = file.parent() { + parent.to_string_lossy().to_string() + } else { + // Fallback to an empty string if there is no parent path + String::new() + } }) .collect::>(); if dirs.len() > 1 {