Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
util: Include path to asset in panic message from asset_str (#27059)
Piotr Osiewicz44fff08ed68d
diff --git a/crates/util/src/util.rs b/crates/util/src/util.rsindex 98ade249fc2..3c12c7bdf4d 100644--- a/crates/util/src/util.rs+++ b/crates/util/src/util.rs@@ -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()),}