Merge pull request #2695 from Integral-Tech/format-concat

Replace `format!` with `concat!` for string literals
This commit is contained in:
Héctor 2025-11-19 00:23:28 +01:00 committed by GitHub
commit 9ef65db8c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 10 deletions

View file

@ -53,9 +53,9 @@ impl Editor {
},
Task::batch([
Task::perform(
load_file(format!(
"{}/src/main.rs",
env!("CARGO_MANIFEST_DIR")
load_file(concat!(
env!("CARGO_MANIFEST_DIR"),
"/src/main.rs",
)),
Message::FileOpened,
),

View file

@ -95,9 +95,9 @@ impl Image {
let i_am_ferris = column![
"Hello!",
Element::from(
image(format!(
"{}/../tour/images/ferris.png",
env!("CARGO_MANIFEST_DIR")
image(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../tour/images/ferris.png",
))
.width(self.width)
.content_fit(self.content_fit)

View file

@ -25,9 +25,9 @@ impl Tiger {
}
fn view(&self) -> Element<'_, Message> {
let handle = svg::Handle::from_path(format!(
"{}/resources/tiger.svg",
env!("CARGO_MANIFEST_DIR")
let handle = svg::Handle::from_path(concat!(
env!("CARGO_MANIFEST_DIR"),
"/resources/tiger.svg",
));
let svg =

View file

@ -559,7 +559,7 @@ fn ferris<'a>(
if cfg!(target_arch = "wasm32") {
image("tour/images/ferris.png")
} else {
image(format!("{}/images/ferris.png", env!("CARGO_MANIFEST_DIR")))
image(concat!(env!("CARGO_MANIFEST_DIR"), "/images/ferris.png"))
}
.filter_method(filter_method)
.width(width),