Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve/inheritance #103

Merged
merged 6 commits into from
Apr 10, 2020
Merged

Improve/inheritance #103

merged 6 commits into from
Apr 10, 2020

Conversation

GopherJ
Copy link
Member

@GopherJ GopherJ commented Apr 10, 2020

Try to solve #99

@codecov
Copy link

codecov bot commented Apr 10, 2020

Codecov Report

Merging #103 into master will increase coverage by 3.96%.
The diff coverage is 86.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
+ Coverage   82.44%   86.41%   +3.96%     
==========================================
  Files          20       20              
  Lines        2803     2841      +38     
==========================================
+ Hits         2311     2455     +144     
+ Misses        492      386     -106     
Impacted Files Coverage Δ
src/adapter/file_adapter.rs 48.93% <ø> (ø)
src/adapter/memory_adapter.rs 37.17% <ø> (ø)
src/cached_enforcer.rs 6.02% <0.00%> (-4.85%) ⬇️
src/config.rs 93.33% <ø> (ø)
src/convert.rs 100.00% <ø> (ø)
src/emitter.rs 50.00% <ø> (ø)
src/model/assertion.rs 64.28% <ø> (ø)
src/model/function_map.rs 96.77% <ø> (ø)
src/rbac/default_role_manager.rs 94.69% <ø> (ø)
src/internal_api.rs 44.23% <75.00%> (+4.01%) ⬆️
... and 5 more

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 09f601d...76e3da9. Read the comment docs.

@GopherJ GopherJ merged commit 9cb77e9 into casbin:master Apr 10, 2020
/// }
/// #[cfg(all(not(feature = "runtime-async-std"), not(feature = "runtime-tokio")))]
/// fn main() {}
/// ```
pub fn enforce<S: AsRef<str>>(&self, rvals: &[S]) -> Result<bool> {
async fn enforce<S: AsRef<str> + Send + Sync>(&mut self, rvals: &[S]) -> Result<bool> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found no mutation in enforce method, do we really need to use &mut self here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants