mirror of
https://github.com/bevyengine/bevy
synced 2024-11-28 15:40:21 +00:00
EmptyPathStream is only used in android/wasm32 (#14200)
# Objective - `EmptyPathStream` is only used in android and wasm32 - This now makes rust nightly warn ## Solution - flag the struct to only be present when needed - also change how `MorphTargetNames` is used because that makes rust happier?
This commit is contained in:
parent
b231ebbc19
commit
a6fde1059c
2 changed files with 5 additions and 3 deletions
|
@ -574,9 +574,11 @@ pub(crate) fn get_meta_path(path: &Path) -> PathBuf {
|
|||
meta_path
|
||||
}
|
||||
|
||||
#[cfg(any(target_arch = "wasm32", target_os = "android"))]
|
||||
/// A [`PathBuf`] [`Stream`] implementation that immediately returns nothing.
|
||||
struct EmptyPathStream;
|
||||
|
||||
#[cfg(any(target_arch = "wasm32", target_os = "android"))]
|
||||
impl Stream for EmptyPathStream {
|
||||
type Item = PathBuf;
|
||||
|
||||
|
|
|
@ -508,9 +508,9 @@ async fn load_gltf<'a, 'b, 'c>(
|
|||
|
||||
mesh.set_morph_targets(handle);
|
||||
let extras = gltf_mesh.extras().as_ref();
|
||||
if let Option::<MorphTargetNames>::Some(names) =
|
||||
extras.and_then(|extras| serde_json::from_str(extras.get()).ok())
|
||||
{
|
||||
if let Some(names) = extras.and_then(|extras| {
|
||||
serde_json::from_str::<MorphTargetNames>(extras.get()).ok()
|
||||
}) {
|
||||
mesh.set_morph_target_names(names.target_names);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue