diff options
| author | tslil clingman <> | 2020-02-10 17:36:50 -0800 |
|---|---|---|
| committer | tslil clingman <> | 2020-02-10 17:36:50 -0800 |
| commit | 15f64980573085e9ab6a9d47fc2a6e8092d6d109 (patch) | |
| tree | e0b6e1119d642592326deaad2f2634d027a98c2d /src/consulter.rs | |
| parent | 942c13ee26b180316f46921531c737fa8eb4197e (diff) | |
Feature completion for 0.2.0
Diffstat (limited to 'src/consulter.rs')
| -rw-r--r-- | src/consulter.rs | 8 |
1 files changed, 6 insertions, 2 deletions
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<GUIResult> { let file = File::create(FILE_NAME)?; @@ -19,3 +19,7 @@ pub fn consult_next_action(game: &Game, proc: &str) -> Result<GUIResult> { Ok(raw) => Ok(GUIResult::Raw(raw.trim().to_string())), } } + +pub fn consulter_clean_up() -> Result<()> { + remove_file(FILE_NAME) +} |
