From c1d9378167ab7a24dcfc59f6f6272d5dab951aa7 Mon Sep 17 00:00:00 2001 From: LiuliFox <88608708+liulifox233@users.noreply.github.com> Date: Tue, 7 Jan 2025 02:02:27 +0800 Subject: [PATCH] feat: fix "Rule should start at 2" bug in MemoryAdapter::load_policy() (#360) * feat: add string adapter * fix: fix MemoryAdapter::load_policy() --- src/adapter/memory_adapter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adapter/memory_adapter.rs b/src/adapter/memory_adapter.rs index 694c55d9..e1e7fb63 100644 --- a/src/adapter/memory_adapter.rs +++ b/src/adapter/memory_adapter.rs @@ -20,7 +20,7 @@ impl Adapter for MemoryAdapter { for line in self.policy.iter() { let sec = &line[0]; let ptype = &line[1]; - let rule = line[1..].to_vec().clone(); + let rule = line[2..].to_vec().clone(); if let Some(t1) = m.get_mut_model().get_mut(sec) { if let Some(t2) = t1.get_mut(ptype) {