From 257020852d78a3b16eb4a71be19429e45671bb68 Mon Sep 17 00:00:00 2001 From: andrewdavidmackenzie <andrew@mackenzie-serres.net> Date: Fri, 24 Feb 2023 22:48:17 +0100 Subject: [PATCH] Remove unused imports and function --- src/lib.rs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d05f7d8..fad7a62 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,10 +29,9 @@ use std::{ collections::BTreeMap, env, fs, - io::{self, stderr, Seek, SeekFrom, Write}, + io::{self, Seek, SeekFrom, Write}, path::Path, - process::{self, Command}, - str::FromStr, + process::{Command}, sync::mpsc::channel, time::{SystemTime, UNIX_EPOCH}, thread, @@ -68,20 +67,6 @@ fn syscall_error(err: syscall::Error) -> io::Error { io::Error::from_raw_os_error(err.errno) } -fn unwrap_or_prompt<T: FromStr>(option: Option<T>, context: &mut liner::Context, prompt: &str) -> Result<T> { - match option { - Some(t) => Ok(t), - None => { - let line = context.read_line( - prompt, - None, - &mut liner::BasicCompleter::new(Vec::<String>::new()) - )?; - T::from_str(&line).map_err(|_err| err_msg("failed to parse input")) - } - } -} - /// Returns a password collected from the user (plaintext) fn prompt_password(prompt: &str, confirm_prompt: &str) -> Result<String> { let stdin = io::stdin(); -- GitLab