Skip to content

Commit

Permalink
fix(clippy): try to make clippy happy
Browse files Browse the repository at this point in the history
Signed-off-by: Chojan Shang <[email protected]>
  • Loading branch information
PsiACE committed Jul 18, 2021
1 parent 31dcc83 commit 719ea49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/rbac/default_role_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down Expand Up @@ -287,10 +287,8 @@ impl Role {
}

fn add_role(&mut self, other_role: Arc<RwLock<Role>>) -> 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);
Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 719ea49

Please sign in to comment.