Skip to content

Commit

Permalink
style: simplify string formatting for readability (#1381)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamirmahal authored Oct 4, 2024
1 parent eafaadb commit 4a5b6e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ fn main() {

fn env_var(var: &str) -> String {
std::env::var(var).unwrap_or_else(|_| {
panic!(
"`{}` is not set, which is needed to generate the kotlin files for android.",
var
)
panic!("`{var}` is not set, which is needed to generate the kotlin files for android.")
})
}

Expand Down Expand Up @@ -61,8 +58,8 @@ fn main() {
.to_uppercase()
);

println!("cargo:rerun-if-env-changed={}", class_extension_env);
println!("cargo:rerun-if-env-changed={}", class_init_env);
println!("cargo:rerun-if-env-changed={class_extension_env}");
println!("cargo:rerun-if-env-changed={class_init_env}");

let content = fs::read_to_string(file.path())
.expect("failed to read kotlin file as string")
Expand Down
2 changes: 1 addition & 1 deletion src/webkitgtk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ pub fn platform_webview_version() -> Result<String> {
webkit_get_micro_version(),
)
};
Ok(format!("{}.{}.{}", major, minor, patch))
Ok(format!("{major}.{minor}.{patch}"))
}

// SAFETY: only use this when you are sure the span will be dropped on the same thread it was entered
Expand Down
2 changes: 1 addition & 1 deletion src/webkitgtk/web_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use soup::{MessageHeaders, MessageHeadersType};
use std::{
borrow::Cow,
cell::RefCell,
collections::{HashSet, VecDeque},
collections::VecDeque,
path::PathBuf,
rc::Rc,
sync::{
Expand Down

0 comments on commit 4a5b6e8

Please sign in to comment.