util: Include path to asset in panic message from asset_str (#27059)
Somebody on Discord ran into issues with running the debugger which goes down to an unwrap in asset_str. Let's print a path that was accessed. Release Notes: - N/A
This commit is contained in:
parent
d4daa0a3a2
commit
44fff08ed6
1 changed files with 1 additions and 1 deletions
|
@ -678,7 +678,7 @@ mod rng {
|
|||
pub use rng::RandomCharIter;
|
||||
/// Get an embedded file as a string.
|
||||
pub fn asset_str<A: rust_embed::RustEmbed>(path: &str) -> Cow<'static, str> {
|
||||
match A::get(path).unwrap().data {
|
||||
match A::get(path).expect(path).data {
|
||||
Cow::Borrowed(bytes) => Cow::Borrowed(std::str::from_utf8(bytes).unwrap()),
|
||||
Cow::Owned(bytes) => Cow::Owned(String::from_utf8(bytes).unwrap()),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue