Remove unused imports and function

This commit is contained in:
andrewdavidmackenzie
2023-02-24 22:48:17 +01:00
parent c91bea9452
commit 257020852d
+2 -17
View File
@@ -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();