OneLauncher-Cracked/packages/oneclient_app/src/assets.rs
2026-08-02 18:17:32 +02:00

16 lines
523 B
Rust

#[derive(rust_embed::RustEmbed)]
#[folder = "./assets/"]
pub struct AppAssets;
impl AppAssets {
pub fn get_bytes(path: &str) -> Option<bytes::Bytes> {
AppAssets::get(path).map(|file| match file.data {
std::borrow::Cow::Borrowed(slice) => bytes::Bytes::copy_from_slice(slice),
std::borrow::Cow::Owned(vec) => {
#[cfg(not(debug_assertions))]
tracing::warn!("Cloning asset data for '{}'", path);
bytes::Bytes::from(vec)
}
})
}
}