Skip to content

Commit eac676b

Browse files
committed
Cleanup, fix warnings
1 parent 75b569a commit eac676b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ use bevy_ecs::prelude::*;
3232
use bevy_reflect::prelude::*;
3333
use bevy_render::{Render, RenderApp, RenderSet};
3434
use bevy_utils::Instant;
35-
use bevy_window::prelude::*;
3635

3736
#[cfg(not(target_arch = "wasm32"))]
3837
use bevy_render::pipelined_rendering::RenderExtractApp;
3938
#[cfg(not(target_arch = "wasm32"))]
39+
use bevy_window::prelude::*;
40+
#[cfg(not(target_arch = "wasm32"))]
4041
use bevy_winit::WinitWindows;
4142

4243
use std::{
@@ -47,7 +48,8 @@ use std::{
4748
#[cfg(feature = "framepace_debug")]
4849
pub mod debug;
4950

50-
/// A dummy label for the subapp of the rendered pipeline that does not exist in wasm32
51+
/// Bevy does not export `RenderExtractApp` on wasm32, so we create a dummy label to ensure this
52+
/// compiles on wasm32.
5153
#[cfg(target_arch = "wasm32")]
5254
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, bevy_app::AppLabel)]
5355
struct RenderExtractApp;
@@ -124,6 +126,7 @@ struct FramepaceSettingsProxy {
124126
limiter: Arc<Mutex<Limiter>>,
125127
}
126128

129+
#[cfg(not(target_arch = "wasm32"))]
127130
impl FramepaceSettingsProxy {
128131
fn is_enabled(&self) -> bool {
129132
self.limiter.try_lock().iter().any(|l| l.is_enabled())
@@ -258,6 +261,7 @@ pub struct FramePaceStats {
258261
/// `spin_sleep` sleeps as long as possible given the platform's sleep accuracy, and spins for the
259262
/// remainder. The dependency is however not WASM compatible, which is fine, because frame limiting
260263
/// should not be used in a browser; this would compete with the browser's frame limiter.
264+
#[allow(unused_variables)]
261265
fn framerate_limiter(
262266
mut timer: ResMut<FrameTimer>,
263267
target_frametime: Res<FrametimeLimit>,

0 commit comments

Comments
 (0)