Main application thread panicked


I'm getting main thread panicked when I install and run Rust binary I published to crates.io. however it works fine when I execute cargo run -- in the project directory.

What could I be doing wrong.
Link to code repository : https://GitHub.com/Opeolluwa/thunderstorm.rs
Crate name : stormz

File an issue with the repository.

It's my repository. Should I still file an issue?

Sorry, didn't realize it was yours.
You are using a relative path to access resources/5lineoblique.flf, which is why you are getting a file not found.
You can embed the file in your source code (if it is small enough) with include_bytes macro.
Alternatively, you have to move them to a standard location by an external build script, or via build.rs.

3 Likes

I have a lot of files, embedding them would make the code ugly and hard to maintain. How do I execute moving them to a standard location by an external build script, or via build.rs. I'm pretty new to rust

"Embedding" here means "replace the code which loads them at runtime with include_bytes!" (or include_str!, if they're Unicode text), not "copy their contents into the code".

1 Like