Merge branch 'test' into 'main'
remove text_io See merge request paris8-rust/rnote!3
This commit is contained in:
		
						commit
						ceb0a4551d
					
				@ -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"
 | 
				
			||||||
 | 
				
			|||||||
@ -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.
 | 
				
			||||||
 | 
				
			|||||||
@ -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(())
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user