From 0108133876702e21203d9e02eb282b0ba93c43b4 Mon Sep 17 00:00:00 2001 From: KunoiSayami <46131041+KunoiSayami@users.noreply.github.com> Date: Tue, 13 Jul 2021 15:42:39 +0800 Subject: feat(test): Add query_is_all_protected() method for test * feat(build): Add optimize option for build release --- src/datastructures.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/datastructures.rs') diff --git a/src/datastructures.rs b/src/datastructures.rs index ba73d96..e004514 100644 --- a/src/datastructures.rs +++ b/src/datastructures.rs @@ -230,6 +230,11 @@ impl Config { pub(crate) fn get_white_list_mode_status(&self) -> bool { self.protect_config.get_white_list_mode_status() } + + #[cfg(test)] + pub(crate) fn query_is_all_protected(&self) -> bool { + self.protect_config.query_is_all_protected() + } } impl TestSuite for Config { @@ -379,6 +384,11 @@ impl ProtectSettings { pub(crate) fn get_white_list_mode_status(&self) -> bool { self.protect_white_list_mode } + + #[cfg(test)] + pub(crate) fn query_is_all_protected(&self) -> bool { + self.protect_enabled && self.protect_white_list_mode && self.repos.is_empty() + } } impl TestSuite for ProtectSettings { -- cgit v1.3.1