From ebc4b3b12b5eae9fc8fd6e084832b389077a68f3 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Wed, 7 May 2025 11:30:17 +0200 Subject: [PATCH] Format code --- src/config.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/config.rs b/src/config.rs index ecc37c0..6c172b3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -4,6 +4,7 @@ use std::io::ErrorKind; use std::path::{Path, PathBuf}; use anyhow::{anyhow, bail, Result}; +use config::{self, Environment, File}; use reqwest::Url; use serde::Deserialize; use uuid::Uuid; @@ -97,14 +98,10 @@ impl Config { .set_default("cmd.stream.rec_input", false)? .set_default("cmd.session.rec_input", false)? .set_default("notifications.enabled", true)? - .add_source(config::File::with_name("/etc/asciinema/config.toml").required(false)) - .add_source( - config::File::with_name(&user_defaults_path()?.to_string_lossy()).required(false), - ) - .add_source( - config::File::with_name(&user_config_path()?.to_string_lossy()).required(false), - ) - .add_source(config::Environment::with_prefix("asciinema").separator("_")); + .add_source(File::with_name("/etc/asciinema/config.toml").required(false)) + .add_source(File::with_name(&user_defaults_path()?.to_string_lossy()).required(false)) + .add_source(File::with_name(&user_config_path()?.to_string_lossy()).required(false)) + .add_source(Environment::with_prefix("asciinema").separator("_")); if let Some(url) = server_url { config = config.set_override("server.url", Some(url))?; @@ -209,11 +206,12 @@ impl Play { fn ask_for_server_url() -> Result { println!("No asciinema server configured for this CLI."); - let mut rl = rustyline::DefaultEditor::new()?; - let url = rl.readline_with_initial( + + let url = rustyline::DefaultEditor::new()?.readline_with_initial( "Enter the server URL to use by default: ", (DEFAULT_SERVER_URL, ""), )?; + println!(); Ok(url)