updated dependencies

This commit is contained in:
veeso
2022-06-09 15:11:55 +02:00
parent 80dea3f71a
commit bb95c9a4d0
6 changed files with 348 additions and 369 deletions

View File

@@ -398,7 +398,7 @@ impl ConfigClient {
/// Returns: (host, username)
fn get_ssh_tokens(host_key: &str) -> (String, String) {
let tokens: Vec<&str> = host_key.split('@').collect();
assert_eq!(tokens.len(), 2);
assert!(tokens.len() >= 2);
(String::from(tokens[1]), String::from(tokens[0]))
}

View File

@@ -30,9 +30,7 @@ pub fn init(level: LogLevel) -> Result<(), String> {
let file: File = open_file(log_file_path.as_path(), true, true, false)
.map_err(|e| format!("Failed to open file {}: {}", log_file_path.display(), e))?;
// Prepare log config
let config = ConfigBuilder::new()
.set_time_format_str("%Y-%m-%dT%H:%M:%S%z")
.build();
let config = ConfigBuilder::new().set_time_format_rfc3339().build();
// Make logger
WriteLogger::init(level, config, file)
.map_err(|e| format!("Failed to initialize logger: {}", e))

View File

@@ -4,7 +4,7 @@
/// Read a secret from tty with customisable prompt
pub fn read_secret_from_tty(prompt: &str) -> std::io::Result<Option<String>> {
match rpassword::read_password_from_tty(Some(prompt)) {
match rpassword::prompt_password(prompt) {
Ok(p) if p.is_empty() => Ok(None),
Ok(p) => Ok(Some(p)),
Err(err) => Err(err),