|
|
|
@ -1,8 +1,3 @@ |
|
|
|
|
use std::cell::Cell; |
|
|
|
|
use std::cell::Ref; |
|
|
|
|
use std::cell::RefCell; |
|
|
|
|
use std::cell::RefMut; |
|
|
|
|
|
|
|
|
|
use crate::slot::Slot; |
|
|
|
|
use std::rc::Rc; |
|
|
|
|
|
|
|
|
@ -44,6 +39,7 @@ impl AnimalDB { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[allow(dead_code)] |
|
|
|
|
pub fn enable_debug(&mut self, yes: bool) { |
|
|
|
|
self.enable_debug = yes; |
|
|
|
|
} |
|
|
|
@ -84,7 +80,7 @@ impl AnimalDB { |
|
|
|
|
drop(following); // must drop this lease, or .take() will panic
|
|
|
|
|
let old_animal = Rc::try_unwrap(updated_branch.take()).unwrap(); |
|
|
|
|
|
|
|
|
|
let mut new_q = NodeStruct { |
|
|
|
|
let new_q = NodeStruct { |
|
|
|
|
kind: NodeType::Question, |
|
|
|
|
text: question, |
|
|
|
|
branch_true: Slot::new(), |
|
|
|
@ -98,7 +94,7 @@ impl AnimalDB { |
|
|
|
|
|
|
|
|
|
user.notify_new_animal(&new_name); |
|
|
|
|
|
|
|
|
|
let mut new_animal = NodeStruct { |
|
|
|
|
let new_animal = NodeStruct { |
|
|
|
|
kind: NodeType::Animal, |
|
|
|
|
text: new_name, |
|
|
|
|
branch_true: Slot::new(), |
|
|
|
|