remove text_io

This commit is contained in:
Volodymyr Patuta 2020-11-27 23:30:06 +01:00
parent 8a689437cf
commit 0a1d29d743
3 changed files with 3 additions and 7 deletions

View File

@ -10,7 +10,6 @@ edition = "2018"
anyhow = "1.0.34" anyhow = "1.0.34"
chrono = "0.4.19" chrono = "0.4.19"
walkdir = "2.3.1" walkdir = "2.3.1"
text_io = "0.1.8"
clap = "2.33.3" clap = "2.33.3"
dialoguer = "0.7.1" dialoguer = "0.7.1"
fstream = "0.1.2" fstream = "0.1.2"

View File

@ -2,7 +2,6 @@ use anyhow::{anyhow, Result};
use chrono::Utc; use chrono::Utc;
use dialoguer::{theme::ColorfulTheme, Confirm, Select}; use dialoguer::{theme::ColorfulTheme, Confirm, Select};
use std::{env, fs, process::Command}; use std::{env, fs, process::Command};
use text_io::read;
use walkdir::WalkDir; use walkdir::WalkDir;
/// Get the path to the root directory of all notes. /// Get the path to the root directory of all notes.

View File

@ -2,7 +2,6 @@ use crate::rnote::notes;
use anyhow::{anyhow, Result}; use anyhow::{anyhow, Result};
use clap::ArgMatches; use clap::ArgMatches;
use dialoguer::{theme::ColorfulTheme, Input}; use dialoguer::{theme::ColorfulTheme, Input};
use text_io::read;
pub fn new(matches: &ArgMatches) -> Result<()> { pub fn new(matches: &ArgMatches) -> Result<()> {
let header = match matches.value_of("header") { let header = match matches.value_of("header") {
@ -19,10 +18,9 @@ pub fn new(matches: &ArgMatches) -> Result<()> {
pub fn remove(matches: &ArgMatches) -> Result<()> { pub fn remove(matches: &ArgMatches) -> Result<()> {
let header = match matches.value_of("header") { let header = match matches.value_of("header") {
Some(s) => s.to_owned(), Some(s) => s.to_owned(),
None => { None => Input::with_theme(&ColorfulTheme::default())
print!("Enter the name of your note: "); .with_prompt("Name of your note")
read!() .interact_text()?,
}
}; };
notes::remove(&header)?; notes::remove(&header)?;
Ok(()) Ok(())