casbin / casbin-rs

An authorization library that supports access control models like ACL, RBAC, ABAC in Rust.
https://casbin.org
Apache License 2.0
828 stars 67 forks source link

feat: avoid duplicate code in default_role_manager #295

Closed greenhandatsjtu closed 2 years ago

greenhandatsjtu commented 2 years ago

There are many duplicate code in default_role_manager.rs , making it hard to understand and maintain code, I improved it by removing duplicate code.

casbin-bot commented 2 years ago

@smrpn @hackerchai @PsiACE @GopherJ please review

codecov[bot] commented 2 years ago

Codecov Report

Merging #295 (ab835e0) into master (5cf0ed5) will decrease coverage by 0.05%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #295      +/-   ##
==========================================
- Coverage   81.51%   81.46%   -0.06%     
==========================================
  Files          23       23              
  Lines        3479     3463      -16     
==========================================
- Hits         2836     2821      -15     
+ Misses        643      642       -1     
Impacted Files Coverage Δ
src/rbac/default_role_manager.rs 97.42% <100.00%> (+0.14%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5cf0ed5...ab835e0. Read the comment docs.

greenhandatsjtu commented 2 years ago

lgtm, however, please update the branch to the latest, we need to get the CI up and running.

Done, thanks.