Skip to content

Commit 979bae8

Browse files
committed
src/global.rs -> src/global_native.rs
1 parent 10722a7 commit 979bae8

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed
File renamed without changes.

src/global_wasm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{Instant, Timer, TimerHandle};
1212

1313
/// Starts a background task, creates a `Timer`, and returns a handle to it.
1414
///
15-
/// > **Note**: Contrary to the original `futures-timer` crate, we don't have
15+
/// > **Note**: Contrary to the native implementation, we don't have
1616
/// > any `forget()` method, as the task is automatically considered
1717
/// > as "forgotten".
1818
pub(crate) fn run() -> TimerHandle {

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
mod arc_list;
2020
mod atomic_waker;
2121
mod delay;
22-
mod global;
2322
mod heap;
2423
mod heap_timer;
2524
mod timer;
25+
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
26+
mod global_native;
2627
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
2728
mod global_wasm;
2829

src/timer.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::Instant;
99
use std::future::Future;
1010

1111
use crate::AtomicWaker;
12-
use crate::{global, ArcList, Heap, HeapTimer, Node, Slot};
12+
use crate::{ArcList, Heap, HeapTimer, Node, Slot};
1313

1414
/// A "timer heap" used to power separately owned instances of `Delay`.
1515
///
@@ -279,7 +279,7 @@ impl Default for TimerHandle {
279279
if fallback == 0 {
280280
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
281281
{
282-
let helper = match global::HelperThread::new() {
282+
let helper = match crate::global_native::HelperThread::new() {
283283
Ok(helper) => helper,
284284
Err(_) => return TimerHandle { inner: Weak::new() },
285285
};
@@ -303,6 +303,7 @@ impl Default for TimerHandle {
303303
{
304304
let handle = crate::global_wasm::run();
305305

306+
// Same as above.
306307
if handle.clone().set_as_global_fallback().is_ok() {
307308
return handle;
308309
}

0 commit comments

Comments
 (0)