From 31dcc836cdb298754e4c42fc1fa5b85df9b7e379 Mon Sep 17 00:00:00 2001 From: Chojan Shang Date: Sun, 18 Jul 2021 17:05:45 +0800 Subject: [PATCH 1/2] build(deps): bump ip_network and rhai Signed-off-by: Chojan Shang --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 08a8e52c..1fc0e7a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,12 +17,12 @@ async-std = { version = "1.9.0", optional = true } async-trait = "0.1.48" globset = { version = "0.4.6", optional = true } ritelinked = { version = "0.3.0", default-features = false, features = ["ahash", "inline-more"] } -ip_network = { version = "0.3.4", optional = true } +ip_network = { version = "0.4.0", optional = true } lazy_static = "1.4.0" lru = { version = "0.6.5", optional = true } parking_lot = "0.11" regex = "1.4.5" -rhai = { version = "0.20.0", features = [ +rhai = { version = "1.0.0", features = [ "sync", "only_i32", "no_function", From 719ea4995db11860a2d2a7dbf5040bb2edd006c6 Mon Sep 17 00:00:00 2001 From: Chojan Shang Date: Sun, 18 Jul 2021 17:11:33 +0800 Subject: [PATCH 2/2] fix(clippy): try to make clippy happy Signed-off-by: Chojan Shang --- src/rbac/default_role_manager.rs | 8 +++----- src/util.rs | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/rbac/default_role_manager.rs b/src/rbac/default_role_manager.rs index e845ea7a..19b426c3 100644 --- a/src/rbac/default_role_manager.rs +++ b/src/rbac/default_role_manager.rs @@ -113,7 +113,7 @@ impl DefaultRoleManager { .filter(|x| Some(x.as_str()) != domain) { for direct_role in - &self.create_role(name, Some(&domain)).read().roles + &self.create_role(name, Some(domain)).read().roles { cloned_role.add_role(Arc::clone(direct_role)); } @@ -287,10 +287,8 @@ impl Role { } fn add_role(&mut self, other_role: Arc>) -> bool { - let not_exists = !self - .roles - .iter() - .any(|role| Arc::ptr_eq(&role, &other_role)); + let not_exists = + !self.roles.iter().any(|role| Arc::ptr_eq(role, &other_role)); if not_exists { self.roles.push(other_role); diff --git a/src/util.rs b/src/util.rs index 9096e033..24b79a8a 100644 --- a/src/util.rs +++ b/src/util.rs @@ -19,7 +19,7 @@ lazy_static! { } pub fn escape_assertion(s: &str) -> String { - ESC_A.replace_all(&s, "${1}_").to_string() + ESC_A.replace_all(s, "${1}_").to_string() } pub fn remove_comment(s: &str) -> String {