Reduce the use of custom cfgs in examples

The `x11_platform`/`wayland_platform` cfgs remain (those are a lot more
involved, so it might still makes sense to use them for clarity).
This commit is contained in:
Mads Marquart
2025-06-05 17:58:28 +02:00
parent 9bf46af6f7
commit 09518309ab
9 changed files with 138 additions and 140 deletions

View File

@@ -12,11 +12,11 @@ use std::collections::HashMap;
use std::mem;
use std::mem::ManuallyDrop;
use std::num::NonZeroU32;
#[cfg(not(web_platform))]
#[cfg(not(target_family = "wasm"))]
use std::time::Instant;
use softbuffer::{Context, Surface};
#[cfg(web_platform)]
#[cfg(target_family = "wasm")]
use web_time::Instant;
use winit::window::{Window, WindowId};

View File

@@ -1,4 +1,4 @@
#[cfg(not(web_platform))]
#[cfg(not(target_family = "wasm"))]
pub fn init() {
use tracing_subscriber::filter::{EnvFilter, LevelFilter};
@@ -9,7 +9,7 @@ pub fn init() {
.init();
}
#[cfg(web_platform)]
#[cfg(target_family = "wasm")]
pub fn init() {
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;