mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-15 19:28:00 +01:00
Merge pull request #641 from hamirmahal/style/simplify-string-formatting
style: simplify string formatting
This commit is contained in:
@@ -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(())
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -12,7 +12,7 @@ macro_rules! info {
|
||||
|
||||
pub fn println(message: String) {
|
||||
if ENABLED.load(SeqCst) {
|
||||
println!("::: {}", message);
|
||||
println!("::: {message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user