Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ae2d7e2

Browse filesBrowse files
committed
reexport instant::{Duration, Instant} from bevy_utils
1 parent 211e009 commit ae2d7e2
Copy full SHA for ae2d7e2

File tree

Expand file treeCollapse file tree

18 files changed

+16
-22
lines changed
Filter options
Expand file treeCollapse file tree

18 files changed

+16
-22
lines changed

‎Cargo.toml

Copy file name to clipboardExpand all lines: Cargo.toml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ anyhow = "1.0"
7777
rand = "0.7.3"
7878
ron = "0.6"
7979
serde = {version = "1", features = ["derive"]}
80-
instant = "0.1"
8180

8281
[[example]]
8382
name = "hello_world"

‎crates/bevy_app/Cargo.toml

Copy file name to clipboardExpand all lines: crates/bevy_app/Cargo.toml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ bevy_utils = { path = "../bevy_utils", version = "0.3.0" }
2323

2424
# other
2525
serde = { version = "1.0", features = ["derive"] }
26-
instant = { version = "0.1", features = ["wasm-bindgen"] }
2726

2827
[target.'cfg(target_arch = "wasm32")'.dependencies]
2928
wasm-bindgen = { version = "0.2" }

‎crates/bevy_app/src/schedule_runner.rs

Copy file name to clipboardExpand all lines: crates/bevy_app/src/schedule_runner.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::{
44
event::{EventReader, Events},
55
plugin::Plugin,
66
};
7-
use instant::{Duration, Instant};
7+
use bevy_utils::{Duration, Instant};
88

99
#[cfg(target_arch = "wasm32")]
1010
use std::{cell::RefCell, rc::Rc};

‎crates/bevy_core/Cargo.toml

Copy file name to clipboardExpand all lines: crates/bevy_core/Cargo.toml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ bevy_type_registry = { path = "../bevy_type_registry", version = "0.3.0" }
2222
bevy_math = { path = "../bevy_math", version = "0.3.0" }
2323
bevy_utils = { path = "../bevy_utils", version = "0.3.0" }
2424
bevy_tasks = { path = "../bevy_tasks", version = "0.3.0" }
25-
instant = { version = "0.1", features = ["wasm-bindgen"] }

‎crates/bevy_core/src/time/time.rs

Copy file name to clipboardExpand all lines: crates/bevy_core/src/time/time.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use bevy_ecs::ResMut;
2-
use instant::{Duration, Instant};
2+
use bevy_utils::{Duration, Instant};
33

44
/// Tracks elapsed time since the last update and since the App has started
55
#[derive(Debug)]

‎crates/bevy_core/src/time/timer.rs

Copy file name to clipboardExpand all lines: crates/bevy_core/src/time/timer.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::time::Time;
22
use bevy_ecs::prelude::*;
33
use bevy_property::Properties;
4-
use instant::Duration;
4+
use bevy_utils::Duration;
55

66
/// Tracks elapsed time. Enters the finished state once `duration` is reached.
77
///

‎crates/bevy_diagnostic/Cargo.toml

Copy file name to clipboardExpand all lines: crates/bevy_diagnostic/Cargo.toml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ bevy_utils = { path = "../bevy_utils", version = "0.3.0" }
2323
# other
2424
uuid = { version = "0.8", features = ["v4", "serde"] }
2525
parking_lot = "0.11.0"
26-
instant = { version = "0.1", features = ["wasm-bindgen"] }

‎crates/bevy_diagnostic/src/diagnostic.rs

Copy file name to clipboardExpand all lines: crates/bevy_diagnostic/src/diagnostic.rs
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use bevy_utils::HashMap;
2-
use instant::{Duration, Instant};
1+
use bevy_utils::{Duration, HashMap, Instant};
32
use std::collections::VecDeque;
43
use uuid::Uuid;
54

‎crates/bevy_diagnostic/src/print_diagnostics_plugin.rs

Copy file name to clipboardExpand all lines: crates/bevy_diagnostic/src/print_diagnostics_plugin.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use super::{Diagnostic, DiagnosticId, Diagnostics};
22
use bevy_app::prelude::*;
33
use bevy_core::{Time, Timer};
44
use bevy_ecs::{Res, ResMut};
5-
use instant::Duration;
5+
use bevy_utils::Duration;
66

77
/// An App Plugin that prints diagnostics to the console
88
pub struct PrintDiagnosticsPlugin {

‎crates/bevy_tasks/Cargo.toml

Copy file name to clipboardExpand all lines: crates/bevy_tasks/Cargo.toml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ futures-lite = "1.4.0"
2020
event-listener = "2.4.0"
2121
async-executor = "1.3.0"
2222
async-channel = "1.4.2"
23-
instant = "0.1"
23+
instant = { version = "0.1", features = ["wasm-bindgen"] }
2424
num_cpus = "1"
2525
[target.'cfg(target_arch = "wasm32")'.dependencies]
2626
wasm-bindgen-futures = "0.4"

‎crates/bevy_tasks/src/countdown_event.rs

Copy file name to clipboardExpand all lines: crates/bevy_tasks/src/countdown_event.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pub fn countdown_event_ready() {
9999
std::thread::spawn(move || futures_lite::future::block_on(countdown_event_clone.listen()));
100100

101101
// Pause to give the new thread time to start blocking (ugly hack)
102-
std::thread::sleep(instant::Duration::from_millis(100));
102+
std::thread::sleep(bevy_utils::Duration::from_millis(100));
103103

104104
countdown_event.decrement();
105105
handle.join().unwrap();

‎crates/bevy_utils/Cargo.toml

Copy file name to clipboardExpand all lines: crates/bevy_utils/Cargo.toml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ keywords = ["bevy"]
1515
[dependencies]
1616
ahash = "0.5.3"
1717
tracing = {version = "0.1", features = ["release_max_level_info"]}
18+
instant = { version = "0.1", features = ["wasm-bindgen"] }
1819

1920
[target.'cfg(target_arch = "wasm32")'.dependencies]
2021
getrandom = {version = "0.2.0", features = ["js"]}

‎crates/bevy_utils/src/lib.rs

Copy file name to clipboardExpand all lines: crates/bevy_utils/src/lib.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
pub use ahash::AHasher;
12
use ahash::RandomState;
3+
pub use instant::{Duration, Instant};
24
use std::{future::Future, pin::Pin};
3-
4-
pub use ahash::AHasher;
55
pub use tracing;
66

77
#[cfg(not(target_arch = "wasm32"))]

‎examples/app/headless.rs

Copy file name to clipboardExpand all lines: examples/app/headless.rs
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use bevy::{app::ScheduleRunnerSettings, prelude::*};
2-
use instant::Duration;
1+
use bevy::{app::ScheduleRunnerSettings, prelude::*, utils::Duration};
32

43
// This example only enables a minimal set of plugins required for bevy to run.
54
// You can also completely remove rendering / windowing Plugin code from bevy

‎examples/app/plugin.rs

Copy file name to clipboardExpand all lines: examples/app/plugin.rs
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use bevy::prelude::*;
2-
use instant::Duration;
1+
use bevy::{prelude::*, utils::Duration};
32

43
/// Plugins are the foundation of Bevy. They are scoped sets of components, resources, and systems
54
/// that provide a specific piece of functionality (generally the smaller the scope, the better).

‎examples/ecs/ecs_guide.rs

Copy file name to clipboardExpand all lines: examples/ecs/ecs_guide.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use bevy::{
22
app::{AppExit, ScheduleRunnerPlugin, ScheduleRunnerSettings},
33
prelude::*,
4+
utils::Duration,
45
};
5-
use instant::Duration;
66
use rand::random;
77

88
/// This is a guided introduction to Bevy's "Entity Component System" (ECS)

‎examples/scene/scene.rs

Copy file name to clipboardExpand all lines: examples/scene/scene.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use bevy::{prelude::*, type_registry::TypeRegistry};
1+
use bevy::{prelude::*, type_registry::TypeRegistry, utils::Duration};
22

33
/// This example illustrates loading and saving scenes from files
44
fn main() {
@@ -37,7 +37,7 @@ struct ComponentA {
3737
struct ComponentB {
3838
pub value: String,
3939
#[property(ignore)]
40-
pub time_since_startup: instant::Duration,
40+
pub time_since_startup: Duration,
4141
}
4242

4343
impl FromResources for ComponentB {

‎examples/wasm/headless_wasm.rs

Copy file name to clipboardExpand all lines: examples/wasm/headless_wasm.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use bevy::{
22
app::{ScheduleRunnerPlugin, ScheduleRunnerSettings},
33
log::LogPlugin,
44
prelude::*,
5+
utils::Duration,
56
};
6-
use instant::Duration;
77

88
fn main() {
99
App::build()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.