mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 21:30:03 -04:00
Replace instant with web-time
This commit is contained in:
@@ -34,9 +34,12 @@
|
||||
//!
|
||||
//! [`EventLoop::run(...)`]: crate::event_loop::EventLoop::run
|
||||
//! [`ControlFlow::WaitUntil`]: crate::event_loop::ControlFlow::WaitUntil
|
||||
use instant::Instant;
|
||||
use smol_str::SmolStr;
|
||||
use std::path::PathBuf;
|
||||
#[cfg(not(wasm_platform))]
|
||||
use std::time::Instant;
|
||||
#[cfg(wasm_platform)]
|
||||
use web_time::Instant;
|
||||
|
||||
#[cfg(doc)]
|
||||
use crate::window::Window;
|
||||
|
||||
@@ -11,9 +11,12 @@ use std::marker::PhantomData;
|
||||
use std::ops::Deref;
|
||||
use std::{error, fmt};
|
||||
|
||||
use instant::{Duration, Instant};
|
||||
use once_cell::sync::OnceCell;
|
||||
use raw_window_handle::{HasRawDisplayHandle, RawDisplayHandle};
|
||||
#[cfg(not(wasm_platform))]
|
||||
use std::time::{Duration, Instant};
|
||||
#[cfg(wasm_platform)]
|
||||
use web_time::{Duration, Instant};
|
||||
|
||||
use crate::{event::Event, monitor::MonitorHandle, platform_impl};
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ use crate::event::{Event, StartCause};
|
||||
use crate::event_loop::ControlFlow;
|
||||
use crate::window::WindowId;
|
||||
|
||||
use instant::{Duration, Instant};
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
clone::Clone,
|
||||
@@ -12,6 +11,7 @@ use std::{
|
||||
ops::Deref,
|
||||
rc::{Rc, Weak},
|
||||
};
|
||||
use web_time::{Duration, Instant};
|
||||
|
||||
pub struct Shared<T: 'static>(Rc<Execution<T>>);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use super::backend;
|
||||
use crate::event_loop::ControlFlow;
|
||||
|
||||
use instant::Instant;
|
||||
use web_time::Instant;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum State {
|
||||
|
||||
Reference in New Issue
Block a user