Replace format! with concat! for string literals
This commit is contained in:
parent
80a3ca7af4
commit
6f5b53eec0
4 changed files with 10 additions and 10 deletions
|
|
@ -53,9 +53,9 @@ impl Editor {
|
||||||
},
|
},
|
||||||
Task::batch([
|
Task::batch([
|
||||||
Task::perform(
|
Task::perform(
|
||||||
load_file(format!(
|
load_file(concat!(
|
||||||
"{}/src/main.rs",
|
env!("CARGO_MANIFEST_DIR"),
|
||||||
env!("CARGO_MANIFEST_DIR")
|
"/src/main.rs",
|
||||||
)),
|
)),
|
||||||
Message::FileOpened,
|
Message::FileOpened,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -95,9 +95,9 @@ impl Image {
|
||||||
let i_am_ferris = column![
|
let i_am_ferris = column![
|
||||||
"Hello!",
|
"Hello!",
|
||||||
Element::from(
|
Element::from(
|
||||||
image(format!(
|
image(concat!(
|
||||||
"{}/../tour/images/ferris.png",
|
env!("CARGO_MANIFEST_DIR"),
|
||||||
env!("CARGO_MANIFEST_DIR")
|
"/../tour/images/ferris.png",
|
||||||
))
|
))
|
||||||
.width(self.width)
|
.width(self.width)
|
||||||
.content_fit(self.content_fit)
|
.content_fit(self.content_fit)
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,9 @@ impl Tiger {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn view(&self) -> Element<'_, Message> {
|
fn view(&self) -> Element<'_, Message> {
|
||||||
let handle = svg::Handle::from_path(format!(
|
let handle = svg::Handle::from_path(concat!(
|
||||||
"{}/resources/tiger.svg",
|
env!("CARGO_MANIFEST_DIR"),
|
||||||
env!("CARGO_MANIFEST_DIR")
|
"/resources/tiger.svg",
|
||||||
));
|
));
|
||||||
|
|
||||||
let svg =
|
let svg =
|
||||||
|
|
|
||||||
|
|
@ -559,7 +559,7 @@ fn ferris<'a>(
|
||||||
if cfg!(target_arch = "wasm32") {
|
if cfg!(target_arch = "wasm32") {
|
||||||
image("tour/images/ferris.png")
|
image("tour/images/ferris.png")
|
||||||
} else {
|
} else {
|
||||||
image(format!("{}/images/ferris.png", env!("CARGO_MANIFEST_DIR")))
|
image(concat!(env!("CARGO_MANIFEST_DIR"), "/images/ferris.png"))
|
||||||
}
|
}
|
||||||
.filter_method(filter_method)
|
.filter_method(filter_method)
|
||||||
.width(width),
|
.width(width),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue