* [pbs-devel] [PATCH proxmox] time: exclude certain `use` statements and `impl` block on wasm32
@ 2024-06-18 13:40 Shannon Sterz
2024-06-19 12:56 ` [pbs-devel] applied: " Wolfgang Bumiller
0 siblings, 1 reply; 2+ messages in thread
From: Shannon Sterz @ 2024-06-18 13:40 UTC (permalink / raw)
To: pbs-devel
otherwise the compiler will complain that they aren't used when
compiling the code for wasm32.
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
proxmox-time/src/calendar_event.rs | 1 +
proxmox-time/src/daily_duration.rs | 2 ++
proxmox-time/src/date_time_value.rs | 1 +
3 files changed, 4 insertions(+)
diff --git a/proxmox-time/src/calendar_event.rs b/proxmox-time/src/calendar_event.rs
index 76883137..4a96c83e 100644
--- a/proxmox-time/src/calendar_event.rs
+++ b/proxmox-time/src/calendar_event.rs
@@ -1,3 +1,4 @@
+#[cfg(not(target_arch = "wasm32"))]
use std::convert::TryInto;
use anyhow::Error;
diff --git a/proxmox-time/src/daily_duration.rs b/proxmox-time/src/daily_duration.rs
index 3b3d5fdd..9a8bdfc7 100644
--- a/proxmox-time/src/daily_duration.rs
+++ b/proxmox-time/src/daily_duration.rs
@@ -1,4 +1,6 @@
use std::cmp::{Ordering, PartialOrd};
+
+#[cfg(not(target_arch = "wasm32"))]
use std::convert::{TryFrom, TryInto};
use anyhow::Error;
diff --git a/proxmox-time/src/date_time_value.rs b/proxmox-time/src/date_time_value.rs
index 72b4c2ee..4dd79d36 100644
--- a/proxmox-time/src/date_time_value.rs
+++ b/proxmox-time/src/date_time_value.rs
@@ -5,6 +5,7 @@ pub(crate) enum DateTimeValue {
Repeated(u32, u32, Option<u32>),
}
+#[cfg(not(target_arch = "wasm32"))]
impl DateTimeValue {
// Test if the entry contains the value
pub fn contains(&self, value: u32) -> bool {
--
2.39.2
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-06-19 12:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-18 13:40 [pbs-devel] [PATCH proxmox] time: exclude certain `use` statements and `impl` block on wasm32 Shannon Sterz
2024-06-19 12:56 ` [pbs-devel] applied: " Wolfgang Bumiller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox