diff --git a/Cargo.toml b/Cargo.toml index 9217ac3..15ab625 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,6 @@ edition = "2018" anyhow = "1.0.34" chrono = "0.4.19" walkdir = "2.3.1" -text_io = "0.1.8" clap = "2.33.3" dialoguer = "0.7.1" fstream = "0.1.2" diff --git a/src/rnote/notes.rs b/src/rnote/notes.rs index ce13cb8..e983822 100644 --- a/src/rnote/notes.rs +++ b/src/rnote/notes.rs @@ -2,7 +2,6 @@ use anyhow::{anyhow, Result}; use chrono::Utc; use dialoguer::{theme::ColorfulTheme, Confirm, Select}; use std::{env, fs, process::Command}; -use text_io::read; use walkdir::WalkDir; /// Get the path to the root directory of all notes. diff --git a/src/rnote/process.rs b/src/rnote/process.rs index ecdfaf8..fb831d5 100644 --- a/src/rnote/process.rs +++ b/src/rnote/process.rs @@ -2,7 +2,6 @@ use crate::rnote::notes; use anyhow::{anyhow, Result}; use clap::ArgMatches; use dialoguer::{theme::ColorfulTheme, Input}; -use text_io::read; pub fn new(matches: &ArgMatches) -> Result<()> { let header = match matches.value_of("header") { @@ -19,10 +18,9 @@ pub fn new(matches: &ArgMatches) -> Result<()> { pub fn remove(matches: &ArgMatches) -> Result<()> { let header = match matches.value_of("header") { Some(s) => s.to_owned(), - None => { - print!("Enter the name of your note: "); - read!() - } + None => Input::with_theme(&ColorfulTheme::default()) + .with_prompt("Name of your note") + .interact_text()?, }; notes::remove(&header)?; Ok(())