casbin / casbin-rs

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

refactor: use `or_default` instead of `or_insert_with` #315

Closed Selflocking closed 2 months ago

Selflocking commented 1 year ago

https://github.com/casbin/casbin-rs/actions/runs/6059164893/job/16441991970

https://rust-lang.github.io/rust-clippy/master/index.html#/unwrap_or_default

codecov[bot] commented 1 year ago

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 67.62%. Comparing base (b429e4d) to head (a9df29b). Report is 14 commits behind head on master.

Files with missing lines Patch % Lines
src/cached_enforcer.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #315 +/- ## ========================================== - Coverage 67.64% 67.62% -0.02% ========================================== Files 24 24 Lines 1774 1773 -1 ========================================== - Hits 1200 1199 -1 Misses 574 574 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 year ago

Benchmark for b429e4d

Click to view benchmark | Test | PR Benchmark | Master Benchmark | % | |------|--------------|------------------|---| | b_benchmark_rbac_model_large | **11.6±0.05ms** | 11.8±0.04ms | **-1.69%** | | benchmark priority model | 6.5±0.01µs | 6.5±0.02µs | 0.00% | | benchmark_abac_model | 3.1±0.00µs | 3.1±0.01µs | 0.00% | | benchmark_basic_model | 5.3±0.01µs | 5.3±0.02µs | 0.00% | | benchmark_key_match | 10.7±0.02µs | 10.7±0.03µs | 0.00% | | benchmark_rbac_model | 9.0±0.01µs | **8.8±0.01µs** | **+2.27%** | | benchmark_rbac_model_medium | **1064.4±0.57µs** | 1082.1±7.48µs | **-1.64%** | | benchmark_rbac_model_with_domains | 9.1±0.02µs | 9.1±0.02µs | 0.00% | | benchmark_rbac_with_deny | **11.2±0.03µs** | 11.9±0.01µs | **-5.88%** | | benchmark_rbac_with_resource_roles | 6.6±0.01µs | **6.5±0.02µs** | **+1.54%** | | benchmark_role_manager_large | 4.9±0.00ms | **4.8±0.00ms** | **+2.08%** | | benchmark_role_manager_medium | **420.4±0.17µs** | 423.2±0.20µs | **-0.66%** | | benchmark_role_manager_small | **110.7±0.48µs** | 112.2±0.06µs | **-1.34%** |
github-actions[bot] commented 1 year ago

Benchmark for b429e4d

Click to view benchmark | Test | PR Benchmark | Master Benchmark | % | |------|--------------|------------------|---| | b_benchmark_rbac_model_large | **11.4±0.05ms** | 11.6±0.05ms | **-1.72%** | | benchmark priority model | **6.3±0.01µs** | 6.4±0.01µs | **-1.56%** | | benchmark_abac_model | 3.1±0.01µs | 3.1±0.01µs | 0.00% | | benchmark_basic_model | 5.2±0.02µs | 5.2±0.02µs | 0.00% | | benchmark_key_match | **10.6±0.02µs** | 10.7±0.03µs | **-0.93%** | | benchmark_rbac_model | **8.7±0.02µs** | 8.9±0.03µs | **-2.25%** | | benchmark_rbac_model_medium | 1054.6±4.74µs | 1050.7±11.77µs | +0.37% | | benchmark_rbac_model_with_domains | **8.6±0.01µs** | 8.8±0.02µs | **-2.27%** | | benchmark_rbac_with_deny | 12.0±0.02µs | 12.0±0.02µs | 0.00% | | benchmark_rbac_with_resource_roles | **6.3±0.01µs** | 6.4±0.01µs | **-1.56%** | | benchmark_role_manager_large | 4.9±0.00ms | 4.9±0.00ms | 0.00% | | benchmark_role_manager_medium | **423.9±0.28µs** | 427.4±0.20µs | **-0.82%** | | benchmark_role_manager_small | **109.3±0.59µs** | 110.1±0.10µs | **-0.73%** |
hsluoyz commented 2 months ago

Closed as stale