diff --git a/crates/bevy_animation/src/transition.rs b/crates/bevy_animation/src/transition.rs index 679c63bec3ffb..c94378208b3a7 100644 --- a/crates/bevy_animation/src/transition.rs +++ b/crates/bevy_animation/src/transition.rs @@ -10,7 +10,7 @@ use bevy_ecs::{ }; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; use bevy_time::Time; -use bevy_utils::Duration; +use core::time::Duration; use crate::{graph::AnimationNodeIndex, ActiveAnimation, AnimationPlayer}; diff --git a/crates/bevy_app/src/schedule_runner.rs b/crates/bevy_app/src/schedule_runner.rs index df3f5843fdcf5..21ff6669ef710 100644 --- a/crates/bevy_app/src/schedule_runner.rs +++ b/crates/bevy_app/src/schedule_runner.rs @@ -3,7 +3,7 @@ use crate::{ plugin::Plugin, PluginsState, }; -use bevy_utils::Duration; +use core::time::Duration; #[cfg(any(target_arch = "wasm32", feature = "std"))] use bevy_utils::Instant; diff --git a/crates/bevy_asset/src/io/embedded/embedded_watcher.rs b/crates/bevy_asset/src/io/embedded/embedded_watcher.rs index cc97eb3cda83c..2e62fb0813ac4 100644 --- a/crates/bevy_asset/src/io/embedded/embedded_watcher.rs +++ b/crates/bevy_asset/src/io/embedded/embedded_watcher.rs @@ -4,7 +4,8 @@ use crate::io::{ AssetSourceEvent, AssetWatcher, }; use alloc::sync::Arc; -use bevy_utils::{tracing::warn, Duration, HashMap}; +use bevy_utils::{tracing::warn, HashMap}; +use core::time::Duration; use notify_debouncer_full::{notify::RecommendedWatcher, Debouncer, RecommendedCache}; use parking_lot::RwLock; use std::{ diff --git a/crates/bevy_asset/src/io/file/file_watcher.rs b/crates/bevy_asset/src/io/file/file_watcher.rs index 9aee5717814b3..e416b99971d82 100644 --- a/crates/bevy_asset/src/io/file/file_watcher.rs +++ b/crates/bevy_asset/src/io/file/file_watcher.rs @@ -2,7 +2,8 @@ use crate::{ io::{AssetSourceEvent, AssetWatcher}, path::normalize_path, }; -use bevy_utils::{tracing::error, Duration}; +use bevy_utils::tracing::error; +use core::time::Duration; use crossbeam_channel::Sender; use notify_debouncer_full::{ new_debouncer, diff --git a/crates/bevy_asset/src/io/source.rs b/crates/bevy_asset/src/io/source.rs index f1b4455179710..da98deaa125de 100644 --- a/crates/bevy_asset/src/io/source.rs +++ b/crates/bevy_asset/src/io/source.rs @@ -7,9 +7,9 @@ use atomicow::CowArc; use bevy_ecs::system::Resource; use bevy_utils::{ tracing::{error, warn}, - Duration, HashMap, + HashMap, }; -use core::{fmt::Display, hash::Hash}; +use core::{fmt::Display, hash::Hash, time::Duration}; use thiserror::Error; use super::{ErasedAssetReader, ErasedAssetWriter}; diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs index 2568badb7e4a5..7a3a06c389d4e 100644 --- a/crates/bevy_asset/src/lib.rs +++ b/crates/bevy_asset/src/lib.rs @@ -641,7 +641,8 @@ mod tests { }; use bevy_log::LogPlugin; use bevy_reflect::TypePath; - use bevy_utils::{Duration, HashMap}; + use bevy_utils::HashMap; + use core::time::Duration; use serde::{Deserialize, Serialize}; use std::path::Path; use thiserror::Error; diff --git a/crates/bevy_diagnostic/src/diagnostic.rs b/crates/bevy_diagnostic/src/diagnostic.rs index 56c1788661501..1c641c88a837a 100644 --- a/crates/bevy_diagnostic/src/diagnostic.rs +++ b/crates/bevy_diagnostic/src/diagnostic.rs @@ -1,9 +1,12 @@ use alloc::{borrow::Cow, collections::VecDeque}; -use core::hash::{Hash, Hasher}; +use core::{ + hash::{Hash, Hasher}, + time::Duration, +}; use bevy_app::{App, SubApp}; use bevy_ecs::system::{Deferred, Res, Resource, SystemBuffer, SystemParam}; -use bevy_utils::{Duration, HashMap, Instant, PassHash}; +use bevy_utils::{HashMap, Instant, PassHash}; use const_fnv1a_hash::fnv1a_hash_str_64; use crate::DEFAULT_MAX_HISTORY_LENGTH; diff --git a/crates/bevy_diagnostic/src/log_diagnostics_plugin.rs b/crates/bevy_diagnostic/src/log_diagnostics_plugin.rs index d6e7a2e0b6a75..6e53bf0a31625 100644 --- a/crates/bevy_diagnostic/src/log_diagnostics_plugin.rs +++ b/crates/bevy_diagnostic/src/log_diagnostics_plugin.rs @@ -2,10 +2,8 @@ use super::{Diagnostic, DiagnosticPath, DiagnosticsStore}; use bevy_app::prelude::*; use bevy_ecs::prelude::*; use bevy_time::{Real, Time, Timer, TimerMode}; -use bevy_utils::{ - tracing::{debug, info}, - Duration, -}; +use bevy_utils::tracing::{debug, info}; +use core::time::Duration; /// An App Plugin that logs diagnostics to the console. /// diff --git a/crates/bevy_gilrs/src/rumble.rs b/crates/bevy_gilrs/src/rumble.rs index 62c6b0dc7d639..da1ce2e2bbfbc 100644 --- a/crates/bevy_gilrs/src/rumble.rs +++ b/crates/bevy_gilrs/src/rumble.rs @@ -8,8 +8,9 @@ use bevy_time::{Real, Time}; use bevy_utils::{ synccell::SyncCell, tracing::{debug, warn}, - Duration, HashMap, + HashMap, }; +use core::time::Duration; use gilrs::{ ff::{self, BaseEffect, BaseEffectType, Repeat, Replay}, GamepadId, diff --git a/crates/bevy_input/src/gamepad.rs b/crates/bevy_input/src/gamepad.rs index be122d73200ad..d51a087eee1fa 100644 --- a/crates/bevy_input/src/gamepad.rs +++ b/crates/bevy_input/src/gamepad.rs @@ -1,6 +1,6 @@ //! The gamepad input functionality. -use core::ops::RangeInclusive; +use core::{ops::RangeInclusive, time::Duration}; use crate::{Axis, ButtonInput, ButtonState}; use alloc::string::String; @@ -21,7 +21,7 @@ use bevy_math::Vec2; use bevy_reflect::{std_traits::ReflectDefault, Reflect}; #[cfg(all(feature = "serialize", feature = "bevy_reflect"))] use bevy_reflect::{ReflectDeserialize, ReflectSerialize}; -use bevy_utils::{Duration, HashMap}; +use bevy_utils::HashMap; use derive_more::derive::From; use log::{info, warn}; use thiserror::Error; @@ -1693,7 +1693,7 @@ impl GamepadRumbleIntensity { /// ``` /// # use bevy_input::gamepad::{Gamepad, GamepadRumbleRequest, GamepadRumbleIntensity}; /// # use bevy_ecs::prelude::{EventWriter, Res, Query, Entity, With}; -/// # use bevy_utils::Duration; +/// # use core::time::Duration; /// fn rumble_gamepad_system( /// mut rumble_requests: EventWriter, /// gamepads: Query>, diff --git a/crates/bevy_picking/src/events.rs b/crates/bevy_picking/src/events.rs index 9d8bda32bda72..c9792ccb8cb37 100644 --- a/crates/bevy_picking/src/events.rs +++ b/crates/bevy_picking/src/events.rs @@ -37,14 +37,14 @@ //! When received by an observer, these events will always be wrapped by the [`Pointer`] type, which contains //! general metadata about the pointer event. -use core::fmt::Debug; +use core::{fmt::Debug, time::Duration}; use bevy_ecs::{prelude::*, query::QueryData, system::SystemParam, traversal::Traversal}; use bevy_hierarchy::Parent; use bevy_math::Vec2; use bevy_reflect::prelude::*; use bevy_render::camera::NormalizedRenderTarget; -use bevy_utils::{tracing::debug, Duration, HashMap, Instant}; +use bevy_utils::{tracing::debug, HashMap, Instant}; use bevy_window::Window; use crate::{ diff --git a/crates/bevy_reflect/src/impls/std.rs b/crates/bevy_reflect/src/impls/std.rs index 0626a76f02d6b..fe59024ce8904 100644 --- a/crates/bevy_reflect/src/impls/std.rs +++ b/crates/bevy_reflect/src/impls/std.rs @@ -118,7 +118,7 @@ impl_reflect_opaque!(::core::ops::RangeTo()); impl_reflect_opaque!(::core::ops::RangeToInclusive()); impl_reflect_opaque!(::core::ops::RangeFull()); impl_reflect_opaque!(::core::ops::Bound()); -impl_reflect_opaque!(::bevy_utils::Duration( +impl_reflect_opaque!(::core::time::Duration( Debug, Hash, PartialEq, @@ -2430,8 +2430,11 @@ mod tests { TypeInfo, TypeRegistry, Typed, VariantInfo, VariantType, }; use alloc::{collections::BTreeMap, string::String, vec}; - use bevy_utils::{Duration, HashMap, Instant}; - use core::f32::consts::{PI, TAU}; + use bevy_utils::{HashMap, Instant}; + use core::{ + f32::consts::{PI, TAU}, + time::Duration, + }; use static_assertions::assert_impl_all; use std::path::Path; diff --git a/crates/bevy_time/src/common_conditions.rs b/crates/bevy_time/src/common_conditions.rs index e00acf8cffb8b..bb9e666319a08 100644 --- a/crates/bevy_time/src/common_conditions.rs +++ b/crates/bevy_time/src/common_conditions.rs @@ -1,6 +1,6 @@ use crate::{Real, Time, Timer, TimerMode, Virtual}; use bevy_ecs::system::Res; -use bevy_utils::Duration; +use core::time::Duration; /// Run condition that is active on a regular time interval, using [`Time`] to advance /// the timer. The timer ticks at the rate of [`Time::relative_speed`]. @@ -8,7 +8,7 @@ use bevy_utils::Duration; /// ```no_run /// # use bevy_app::{App, NoopPluginGroup as DefaultPlugins, PluginGroup, Update}; /// # use bevy_ecs::schedule::IntoSystemConfigs; -/// # use bevy_utils::Duration; +/// # use core::time::Duration; /// # use bevy_time::common_conditions::on_timer; /// fn main() { /// App::new() @@ -48,7 +48,7 @@ pub fn on_timer(duration: Duration) -> impl FnMut(Res