From 9390b57999dd627ece900e528b74a0c2b59451a9 Mon Sep 17 00:00:00 2001 From: Philip Hayes Date: Mon, 22 May 2023 10:38:53 -0700 Subject: [PATCH 1/2] 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>, From 66228d94357ffc221245198b8f9f3f7dcdc6f9f0 Mon Sep 17 00:00:00 2001 From: Daniel Brotsky Date: Wed, 24 May 2023 12:29:12 -0700 Subject: [PATCH 2/2] Reorder declarations to maintain consistency. The keystores are all declared (and the default set) before we load the credential and error modules. --- src/lib.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 2957e0e..90a77e0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -142,14 +142,7 @@ pub mod ios; #[cfg(target_os = "ios")] use ios as default; -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", @@ -159,6 +152,9 @@ pub mod mock; )))] use mock as default; +pub mod credential; +pub mod error; + #[derive(Default, Debug)] struct EntryBuilder { inner: Option>,