From 9f23e1a75d8f01b66c1deb515472244abe928f26 Mon Sep 17 00:00:00 2001 From: Ferdinand Schober Date: Mon, 18 Dec 2023 20:54:06 +0100 Subject: [PATCH] remove unused code --- src/ioutils.rs | 48 ------------------------------------------------ src/lib.rs | 1 - 2 files changed, 49 deletions(-) delete mode 100644 src/ioutils.rs diff --git a/src/ioutils.rs b/src/ioutils.rs deleted file mode 100644 index 0c54172c..00000000 --- a/src/ioutils.rs +++ /dev/null @@ -1,48 +0,0 @@ -use std::io::{self, Write}; - -use crate::client::Position; - -pub fn ask_confirmation(default: bool) -> Result { - eprint!("{}", if default { " [Y,n] " } else { " [y,N] " }); - io::stderr().flush()?; - let answer = loop { - let mut buffer = String::new(); - io::stdin().read_line(&mut buffer)?; - let answer = buffer.to_lowercase(); - let answer = answer.trim(); - match answer { - "" => break default, - "y" => break true, - "n" => break false, - _ => { - eprint!("Enter y for Yes or n for No: "); - io::stderr().flush()?; - continue; - } - } - }; - Ok(answer) -} - -pub fn ask_position() -> Result { - eprint!("Enter position - top (t) | bottom (b) | left(l) | right(r): "); - io::stderr().flush()?; - let pos = loop { - let mut buffer = String::new(); - io::stdin().read_line(&mut buffer)?; - let answer = buffer.to_lowercase(); - let answer = answer.trim(); - match answer { - "t" | "top" => break Position::Top, - "b" | "bottom" => break Position::Bottom, - "l" | "left" => break Position::Right, - "r" | "right" => break Position::Left, - _ => { - eprint!("Invalid position: {answer} - enter top (t) | bottom (b) | left(l) | right(r): "); - io::stderr().flush()?; - continue; - } - }; - }; - Ok(pos) -} diff --git a/src/lib.rs b/src/lib.rs index 0d833f27..9fc69087 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,5 +9,4 @@ pub mod producer; pub mod backend; pub mod frontend; -pub mod ioutils; pub mod scancode;