Skip to content

Commit

Permalink
Move stub into local/mod.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker authored and djc committed May 26, 2023
1 parent 2b7a068 commit 51cce84
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
29 changes: 19 additions & 10 deletions src/offset/local/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ use crate::naive::{NaiveDate, NaiveDateTime, NaiveTime};
use crate::Date;
use crate::{DateTime, Utc};

// we don't want `stub.rs` when the target_os is not wasi or emscripten
// as we use js-sys to get the date instead
#[cfg(unix)]
#[path = "unix.rs"]
mod inner;

#[cfg(windows)]
#[path = "windows.rs"]
mod inner;

#[cfg(all(
not(unix),
not(windows),
Expand All @@ -24,16 +30,19 @@ use crate::{DateTime, Utc};
not(any(target_os = "emscripten", target_os = "wasi"))
))
))]
#[path = "stub.rs"]
mod inner;
mod inner {
use crate::{FixedOffset, LocalResult, NaiveDateTime};

#[cfg(unix)]
#[path = "unix.rs"]
mod inner;
pub(super) fn offset_from_utc_datetime(_utc_time: &NaiveDateTime) -> LocalResult<FixedOffset> {
LocalResult::Single(FixedOffset::east_opt(0).unwrap())
}

#[cfg(windows)]
#[path = "windows.rs"]
mod inner;
pub(super) fn offset_from_local_datetime(
_local_time: &NaiveDateTime,
) -> LocalResult<FixedOffset> {
LocalResult::Single(FixedOffset::east_opt(0).unwrap())
}
}

#[cfg(unix)]
mod tz_info;
Expand Down
19 changes: 0 additions & 19 deletions src/offset/local/stub.rs

This file was deleted.

0 comments on commit 51cce84

Please sign in to comment.