diff --git a/src/animals.rs b/src/animals.rs index d794c5c..a8c7d7c 100644 --- a/src/animals.rs +++ b/src/animals.rs @@ -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(), diff --git a/src/main.rs b/src/main.rs index 8b7e1c7..ec1c28b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -94,7 +94,7 @@ macro_rules! map( ); fn main() { - let mut db = animals::AnimalDB::new(); + let db = animals::AnimalDB::new(); let duck = AnswerMachine { answer: "duck".to_string(), diff --git a/src/slot.rs b/src/slot.rs index e2bcdb4..ef4846a 100644 --- a/src/slot.rs +++ b/src/slot.rs @@ -8,6 +8,7 @@ pub struct Slot { v: RefCell>>, } +#[allow(dead_code)] // some methods are unused, shut up the compiler impl Slot { /// Create a slot ///