Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "can't leak crate-private type in stub.rs" #662 #684

Merged
merged 7 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,30 @@ jobs:
RUST_VERSION: stable
WASM: wasm_emscripten

wasm_unknown:
strategy:
matrix:
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
default: true

- name: Build and Test
run: bash ci/github.sh
env:
RUST_VERSION: stable
WASM: wasm_unknown

cross-targets:
strategy:
matrix:
Expand Down
6 changes: 6 additions & 0 deletions ci/github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ meaningful in the github actions feature matrix UI.
test_wasm_simple
elif [[ ${WASM:-} == wasm_emscripten ]]; then
test_wasm_emscripten
elif [[ ${WASM:-} == wasm_unknown ]]; then
test_wasm_unknown
elif [[ ${CORE:-} == no_std ]]; then
test_core
elif [[ ${EXHAUSTIVE_TZ:-} == all_tzs ]]; then
Expand Down Expand Up @@ -118,4 +120,8 @@ test_wasm_emscripten() {
runt cargo build --target wasm32-unknown-emscripten
}

test_wasm_unknown() {
runt cargo build --target wasm32-unknown-unknown
}

main "$@"
6 changes: 3 additions & 3 deletions src/offset/sys/stub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ fn tm_to_time(tm: &Tm) -> i64 {
+ s
}

pub fn time_to_local_tm(sec: i64, tm: &mut Tm) {
pub(super) fn time_to_local_tm(sec: i64, tm: &mut Tm) {
// FIXME: Add timezone logic
time_to_tm(sec, tm);
}

pub fn utc_tm_to_time(tm: &Tm) -> i64 {
pub(super) fn utc_tm_to_time(tm: &Tm) -> i64 {
tm_to_time(tm)
}

pub fn local_tm_to_time(tm: &Tm) -> i64 {
pub(super) fn local_tm_to_time(tm: &Tm) -> i64 {
// FIXME: Add timezone logic
tm_to_time(tm)
}