From 15f64980573085e9ab6a9d47fc2a6e8092d6d109 Mon Sep 17 00:00:00 2001 From: tslil clingman <> Date: Mon, 10 Feb 2020 17:36:50 -0800 Subject: Feature completion for 0.2.0 --- src/consulter.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/consulter.rs') diff --git a/src/consulter.rs b/src/consulter.rs index 091eec0..250fd1c 100644 --- a/src/consulter.rs +++ b/src/consulter.rs @@ -1,11 +1,11 @@ -use std::fs::File; +use std::fs::{remove_file, File}; use std::io::{Error, ErrorKind, Result, Write}; use std::process::Command; use crate::game::*; use crate::gui::*; -const FILE_NAME: &str = "/tmp/takwrap_ptn_consult.ptn"; +pub const FILE_NAME: &str = "takwrap_ptn_consult.ptn"; pub fn consult_next_action(game: &Game, proc: &str) -> Result { let file = File::create(FILE_NAME)?; @@ -19,3 +19,7 @@ pub fn consult_next_action(game: &Game, proc: &str) -> Result { Ok(raw) => Ok(GUIResult::Raw(raw.trim().to_string())), } } + +pub fn consulter_clean_up() -> Result<()> { + remove_file(FILE_NAME) +} -- cgit v1.3.1