mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-03 05:12:55 +00:00
Improve error message when i-slint-core-macro's attempt to read link-data.json fails
Provide the (absolute) path to the file in the panic message.
This commit is contained in:
parent
7d20db9be0
commit
cf910d3f23
1 changed files with 1 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ impl syn::visit_mut::VisitMut for Visitor {
|
|||
impl Visitor {
|
||||
pub fn new() -> Self {
|
||||
let link_path = concat!(env!("CARGO_MANIFEST_DIR"), "/link-data.json");
|
||||
let link_data = std::fs::read_to_string(link_path).expect("Failed to read link-data.json");
|
||||
let link_data = std::fs::read_to_string(link_path).expect("Failed to read {link_path}");
|
||||
let link_data: serde_json::Value =
|
||||
serde_json::from_str(&link_data).expect("Failed to parse link-data.json");
|
||||
Self(link_data, false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue