Skip to content

Commit

Permalink
Use clone_from() as it performs better in some cases
Browse files Browse the repository at this point in the history
Fixes #519
  • Loading branch information
nitisht committed Sep 29, 2023
1 parent 1a1c340 commit 4697f85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/rbac/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub fn init(metadata: &StorageMetadata) {
let users = metadata.users.clone();
let mut roles = metadata.roles.clone();

*DEFAULT_ROLE.lock().unwrap() = metadata.default_role.clone();
DEFAULT_ROLE.lock().unwrap().clone_from(&metadata.default_role);

let admin_privilege = DefaultPrivilege::Admin;
let admin_permissions = RoleBuilder::from(&admin_privilege).build();
Expand Down

0 comments on commit 4697f85

Please sign in to comment.