14 lines
340 B
Rust
14 lines
340 B
Rust
use anyhow::{anyhow, Result};
|
|
use gpui::AssetSource;
|
|
use rust_embed::RustEmbed;
|
|
|
|
#[derive(RustEmbed)]
|
|
#[folder = "assets"]
|
|
pub struct Assets;
|
|
|
|
impl AssetSource for Assets {
|
|
fn load(&self, path: &str) -> Result<std::borrow::Cow<[u8]>> {
|
|
Self::get(path).ok_or_else(|| anyhow!("could not find asset at path \"{}\"", path))
|
|
}
|
|
}
|