From 7d23ab9dc6bfcf23ee227966400e101dfd1b7508 Mon Sep 17 00:00:00 2001 From: askiiart Date: Mon, 13 Jan 2025 15:59:05 -0600 Subject: [PATCH 1/2] minor cli improvement --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 26e1da6..545ee89 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,10 @@ extern crate cat2text; use cat2text::{base4, core}; -use std::{io, process::exit}; +use std::{io::{self, stdout, Write}, process::exit}; fn main() { let stdin = io::stdin(); - let mut input = String::new(); + let mut input; loop { println!("Pick your translation:"); @@ -12,6 +12,8 @@ fn main() { println!("2) text to cat"); input = "".to_string(); stdin.read_line(&mut input).unwrap(); + print!("~> "); + stdout().flush().unwrap(); let trimmed = input.trim(); if trimmed == "1".to_string() { input = "".to_string(); From 995aee7e871d28288c7f503c8ddf341c65ff91c8 Mon Sep 17 00:00:00 2001 From: askiiart Date: Mon, 13 Jan 2025 16:11:10 -0600 Subject: [PATCH 2/2] clean up imports --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 545ee89..c883fbd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ extern crate cat2text; -use cat2text::{base4, core}; -use std::{io::{self, stdout, Write}, process::exit}; +use cat2text::base4; +use std::io::{self, stdout, Write}; fn main() { let stdin = io::stdin();