From 05e28b9e546eca62b822025027c6f35697bc0bac Mon Sep 17 00:00:00 2001 From: stringhandler Date: Tue, 29 Aug 2023 22:15:43 +0200 Subject: [PATCH] fix: fix compile on windows --- rust-toolchain.toml | 2 +- src/lib.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7b8c02c..b9bb31e 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ # this should match the nightly version in tari-project/tari # only used for cargo fmt settings, repo should always compile on stable too [toolchain] -channel = "nightly-2022-11-03" \ No newline at end of file +channel = "stable" diff --git a/src/lib.rs b/src/lib.rs index 96ec8c5..d389c09 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -258,7 +258,10 @@ impl RandomXDataset { 0 => Err(RandomXError::Other("Dataset item count was 0".to_string())), x => { // This weirdness brought to you by c_ulong being different on Windows and Linux - Ok(u32::try_from(x)?) + #[cfg(target_os = "windows")] + return Ok(x); + #[cfg(target_os = "linux")] + return Ok(u32::try_from(x)?); }, } }