Skip to content

Commit

Permalink
feat: fix incompatible trait implementation with Casbin-rs 2.1.0 (#84)
Browse files Browse the repository at this point in the history
* fix: Update trait definition for casbin-rs 2.1.0 (#83)

* fix: clippy fix for redundant guard
  • Loading branch information
Peterburnett authored Dec 17, 2023
1 parent 5c9c4da commit 25c841a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version = "0.9.0"
[dependencies]
async-std = { version = "1.9.0", default-features = false, optional = true }
async-trait = "0.1.42"
casbin = { version = "2.0.6", default-features = false }
casbin = { version = "2.1.0", default-features = false }
diesel = { version = "2.0.3", default-features = false, features = ["r2d2"] }
futures = "0.3"
libsqlite3-sys = { version = "0.26.0", features = ["bundled"] }
Expand All @@ -38,4 +38,4 @@ lto = true
opt-level = 3

[profile.dev]
split-debuginfo = "unpacked"
split-debuginfo = "unpacked"
2 changes: 1 addition & 1 deletion src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub fn remove_policies(mut conn: Pool, pt: &str, rules: Vec<Vec<String>>) -> Res
.and(v5.eq(&rule[5]));

match diesel::delete(casbin_rule.filter(filter)).execute(conn) {
Ok(n) if n == 1 => continue,
Ok(1) => continue,
_ => return Err(DieselError::RollbackTransaction),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ fn normalize_policy(casbin_rule: &CasbinRule) -> Option<Vec<String>> {

#[async_trait]
impl Adapter for DieselAdapter {
async fn load_policy(&self, m: &mut dyn Model) -> Result<()> {
async fn load_policy(&mut self, m: &mut dyn Model) -> Result<()> {
let conn = self
.pool
.get()
Expand Down

0 comments on commit 25c841a

Please sign in to comment.