mirror of
https://github.com/ellmau/adf-obdd.git
synced 2025-12-19 09:29:36 +01:00
fixed borrowing issues
Signed-off-by: Stefan Ellmauthaler <stefan.ellmauthaler@tu-dresden.de>
This commit is contained in:
parent
35918ce36e
commit
b4f1dd263e
17
src/adf.rs
17
src/adf.rs
@ -58,13 +58,16 @@ impl Adf {
|
||||
self.stmts.len()
|
||||
}
|
||||
|
||||
pub fn add_ac(&mut self, statement: &str, ac: &str) {
|
||||
if let Some(stmt) = self.dict.get(statement) {
|
||||
let stm = *stmt;
|
||||
let ac_nmbr = self.parseformula(ac);
|
||||
self.set_ac(stm, ac_nmbr)
|
||||
}
|
||||
}
|
||||
pub fn add_ac(&mut self, statement: &str, ac: &str) {
|
||||
if let Some(stmt) = self.dict.get(statement) {
|
||||
self.add_ac_by_number(*stmt, ac)
|
||||
}
|
||||
}
|
||||
|
||||
fn add_ac_by_number(&mut self, st:usize, ac: &str){
|
||||
let ac_num = self.parseformula(ac);
|
||||
self.set_ac(st, ac_num);
|
||||
}
|
||||
|
||||
fn set_ac(&mut self, st: usize, ac: usize) {
|
||||
self.stmts[st].ac = Some(ac);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user