From 9390b57999dd627ece900e528b74a0c2b59451a9 Mon Sep 17 00:00:00 2001 From: Philip Hayes Date: Mon, 22 May 2023 10:38:53 -0700 Subject: [PATCH] Unsupported platforms default to the mock backend so we always compile. Closes: #127 --- src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index f548d76..2957e0e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -146,6 +146,19 @@ pub mod credential; pub mod error; pub mod mock; +// Unsupported platforms use the mock backend as default. That way the crate +// always compiles, but the user must provide their own backend to actually +// persist keys. + +#[cfg(not(any( + target_os = "linux", + target_os = "freebsd", + target_os = "macos", + target_os = "ios", + target_os = "windows", +)))] +use mock as default; + #[derive(Default, Debug)] struct EntryBuilder { inner: Option>,