Skip to content
Snippets Groups Projects
Commit 25702085 authored by Andrew Mackenzie's avatar Andrew Mackenzie
Browse files

Remove unused imports and function

parent c91bea94
No related branches found
No related tags found
1 merge request!17Remove unused imports and function
...@@ -29,10 +29,9 @@ use std::{ ...@@ -29,10 +29,9 @@ use std::{
collections::BTreeMap, collections::BTreeMap,
env, env,
fs, fs,
io::{self, stderr, Seek, SeekFrom, Write}, io::{self, Seek, SeekFrom, Write},
path::Path, path::Path,
process::{self, Command}, process::{Command},
str::FromStr,
sync::mpsc::channel, sync::mpsc::channel,
time::{SystemTime, UNIX_EPOCH}, time::{SystemTime, UNIX_EPOCH},
thread, thread,
...@@ -68,20 +67,6 @@ fn syscall_error(err: syscall::Error) -> io::Error { ...@@ -68,20 +67,6 @@ fn syscall_error(err: syscall::Error) -> io::Error {
io::Error::from_raw_os_error(err.errno) 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) /// Returns a password collected from the user (plaintext)
fn prompt_password(prompt: &str, confirm_prompt: &str) -> Result<String> { fn prompt_password(prompt: &str, confirm_prompt: &str) -> Result<String> {
let stdin = io::stdin(); let stdin = io::stdin();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment