From 3e2fbfa216ecd559d43f4690b4f45278e6ce36b6 Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Mon, 11 Dec 2017 11:04:25 -0800 Subject: [PATCH] fix flaw --- src/lib.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 7ac9282..452512f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,6 @@ mod commands; -use std::fmt; #[derive(Debug)] pub struct Engine<'a, R, W> { @@ -32,8 +31,8 @@ pub struct Engine<'a, R, W> { /// Additionally this code should have a parser. You call it with the reader supplied and it waits for a command /// and parses it into a tuple of some kind for the user. -impl<'a> Engine<'a, R, W> { - pub fn new(name: &'a str, author: &'a str, reader: R, writer: W) -> Engine<'a> { +impl<'a, R, W> Engine<'a, R, W> { + pub fn new(name: &'a str, author: &'a str, reader: R, writer: W) -> Engine<'a, R, W> { // TODO: This should also take an EngineOptions thing that indicates which options are supported // so that when called it can send them easily. @@ -41,14 +40,12 @@ impl<'a> Engine<'a, R, W> { Engine { name: name, author: author, - reader: R, - writer: W, + reader: reader, + writer: writer, } } /// Sends identification messages to the writer for the GUI to pick up - /// TODO: Write tests for this. Reference: - /// https://stackoverflow.com/questions/28370126/how-can-i-test-stdin-and-stdout pub fn identify(&mut self) { let name_id: String = format!("{} {} {}", commands::ID, commands::NAME, self.name); let author_id: String = format!("{} {} {}", commands::ID, commands::AUTHOR, self.author);