Merge pull request #641 from hamirmahal/style/simplify-string-formatting

style: simplify string formatting
This commit is contained in:
Marcin Kulik
2024-10-17 11:45:44 +02:00
committed by GitHub
4 changed files with 6 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ impl Command for cli::Auth {
let auth_url = api::get_auth_url(config)?;
println!("Open the following URL in a web browser to authenticate this asciinema CLI with your {server_hostname} user account:\n");
println!("{}\n", auth_url);
println!("{auth_url}\n");
println!("This action will associate all recordings uploaded from this machine (past and future ones) with your account, allowing you to manage them (change the title/theme, delete) at {server_hostname}.");
Ok(())

View File

@@ -11,9 +11,9 @@ pub fn check_utf8_locale() -> anyhow::Result<()> {
Ok(())
} else {
let env = env::var("LC_ALL")
.map(|v| format!("LC_ALL={}", v))
.or(env::var("LC_CTYPE").map(|v| format!("LC_CTYPE={}", v)))
.or(env::var("LANG").map(|v| format!("LANG={}", v)))
.map(|v| format!("LC_ALL={v}"))
.or(env::var("LC_CTYPE").map(|v| format!("LC_CTYPE={v}")))
.or(env::var("LANG").map(|v| format!("LANG={v}")))
.unwrap_or("".to_string());
Err(anyhow::anyhow!("asciinema requires ASCII or UTF-8 character encoding. The environment ({}) specifies the character set \"{}\". Check the output of `locale` command.", env, encoding))

View File

@@ -12,7 +12,7 @@ macro_rules! info {
pub fn println(message: String) {
if ENABLED.load(SeqCst) {
println!("::: {}", message);
println!("::: {message}");
}
}

View File

@@ -35,7 +35,7 @@ impl TmuxNotifier {
impl Notifier for TmuxNotifier {
fn notify(&mut self, message: String) -> Result<()> {
let args = ["display-message", &format!("asciinema: {}", message)];
let args = ["display-message", &format!("asciinema: {message}")];
exec(&mut Command::new(&self.0), &args)
}