Skip to content

Commit

Permalink
Use unwrap_or_clone instead of (*foo).clone()
Browse files Browse the repository at this point in the history
Signed-off-by: John Kastner <jkastner@amazon.com>
  • Loading branch information
john-h-kastner-aws committed Dec 31, 2024
1 parent e3e6d85 commit c43279e
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 99 deletions.
2 changes: 1 addition & 1 deletion cedar-policy-core/src/ast/policy_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ impl PolicySet {
match self.templates.remove(policy_id) {
Some(t) => {
self.template_to_links_map.remove(policy_id);
Ok((*t).clone())
Ok(Arc::unwrap_or_clone(t))
}
None => panic!("Found in template_to_links_map but not in templates"),
}
Expand Down
Loading

0 comments on commit c43279e

Please sign in to comment.