refactor: use small_rng for Emscripten only, simplify platform to top-level functions only, no trait/struct

This commit is contained in:
Ryan Walters
2025-09-03 11:11:04 -05:00
parent 208ad3e733
commit 4cc5816d1f
9 changed files with 256 additions and 251 deletions

View File

@@ -44,7 +44,7 @@ impl Asset {
mod imp {
use super::*;
use crate::error::AssetError;
use crate::platform::get_platform;
use crate::platform;
/// Loads asset bytes using the appropriate platform-specific method.
///
@@ -58,7 +58,7 @@ mod imp {
/// Returns `AssetError::NotFound` if the asset file cannot be located (Emscripten only),
/// or `AssetError::Io` for filesystem I/O failures.
pub fn get_asset_bytes(asset: Asset) -> Result<Cow<'static, [u8]>, AssetError> {
get_platform().get_asset_bytes(asset)
platform::get_asset_bytes(asset)
}
}