Skip to content

Commit 93d89c5

Browse files
authored
Merge pull request #2169 from rust-lang/push-qvyqnvqrsmsx
Fix title of footer logos
2 parents 0136a6b + f736d72 commit 93d89c5

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

src/category.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<'r> FromParam<'r> for Category {
3131
if is_category(&url) {
3232
Ok(Category { name: url })
3333
} else {
34-
Err(format!("No category called <{}>", url))
34+
Err(format!("No category called <{url}>"))
3535
}
3636
}
3737
}

src/i18n.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn add_bundle_functions(bundle: &mut FluentBundle<&'static FluentResource>) {
2222
Some(FluentValue::String(s)) => s,
2323
_ => return FluentValue::None,
2424
};
25-
FluentValue::String(format!("<a href='mailto:{0}' lang='en-US'>{0}</a>", email).into())
25+
FluentValue::String(format!("<a href='mailto:{email}' lang='en-US'>{email}</a>").into())
2626
})
2727
.expect("could not add function");
2828

@@ -32,7 +32,7 @@ fn add_bundle_functions(bundle: &mut FluentBundle<&'static FluentResource>) {
3232
Some(FluentValue::String(s)) => s,
3333
_ => return FluentValue::None,
3434
};
35-
FluentValue::String(format!("<span lang='en-US'>{0}</span>", text).into())
35+
FluentValue::String(format!("<span lang='en-US'>{text}</span>").into())
3636
})
3737
.expect("could not add function");
3838
}

src/main.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fn baseurl(lang: &str) -> String {
125125
if lang == "en-US" {
126126
String::new()
127127
} else {
128-
format!("/{}", lang)
128+
format!("/{lang}")
129129
}
130130
}
131131

@@ -274,13 +274,13 @@ fn hash_css(css: &str) -> String {
274274
}
275275

276276
fn compile_sass(filename: &str) -> String {
277-
let scss_file = format!("./src/styles/{}.scss", filename);
277+
let scss_file = format!("./src/styles/{filename}.scss");
278278

279279
let css = compile_file(&scss_file, Options::default())
280280
.unwrap_or_else(|_| panic!("couldn't compile sass: {}", &scss_file));
281281

282282
let css_sha = format!("{}_{}", filename, hash_css(&css));
283-
let css_file = format!("./static/styles/{}.css", css_sha);
283+
let css_file = format!("./static/styles/{css_sha}.css");
284284

285285
fs::write(&css_file, css.into_bytes())
286286
.unwrap_or_else(|_| panic!("couldn't write css file: {}", &css_file));
@@ -291,7 +291,7 @@ fn compile_sass(filename: &str) -> String {
291291
fn concat_vendor_css(files: Vec<&str>) -> String {
292292
let mut concatted = String::new();
293293
for filestem in files {
294-
let vendor_path = format!("./static/styles/{}.css", filestem);
294+
let vendor_path = format!("./static/styles/{filestem}.css");
295295
let contents = fs::read_to_string(vendor_path).expect("couldn't read vendor css");
296296
concatted.push_str(&contents);
297297
}
@@ -307,7 +307,7 @@ fn concat_vendor_css(files: Vec<&str>) -> String {
307307
fn concat_app_js(files: Vec<&str>) -> String {
308308
let mut concatted = String::new();
309309
for filestem in files {
310-
let vendor_path = format!("./static/scripts/{}.js", filestem);
310+
let vendor_path = format!("./static/scripts/{filestem}.js");
311311
let contents = fs::read_to_string(vendor_path).expect("couldn't read app js");
312312
concatted.push_str(&contents);
313313
}
@@ -354,7 +354,7 @@ async fn render_governance(
354354
Ok(Template::render(page, context))
355355
}
356356
Err(err) => {
357-
eprintln!("error while loading the governance page: {}", err);
357+
eprintln!("error while loading the governance page: {err}");
358358
Err(Status::InternalServerError)
359359
}
360360
}
@@ -377,7 +377,7 @@ async fn render_team(
377377
if err.is::<teams::TeamNotFound>() {
378378
Err(Status::NotFound)
379379
} else {
380-
eprintln!("error while loading the team page: {}", err);
380+
eprintln!("error while loading the team page: {err}");
381381
Err(Status::InternalServerError)
382382
}
383383
}
@@ -392,7 +392,7 @@ fn render_subject(category: Category, subject: &str, lang: String) -> Result<Tem
392392
// To work around the problem we check whether the template exists beforehand.
393393
let path = Path::new("templates")
394394
.join(category.name())
395-
.join(format!("{}.html.hbs", subject));
395+
.join(format!("{subject}.html.hbs"));
396396
if !path.is_file() {
397397
return Err(Status::NotFound);
398398
}

src/redirect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ pub(crate) fn maybe_redirect(path: Path) -> Option<Redirect> {
121121
if let Some((_, dest)) = EXTERNAL_REDIRECTS.iter().find(|(src, _)| *src == path) {
122122
Some(Redirect::permanent(*dest))
123123
} else if let Some((_, dest)) = PAGE_REDIRECTS.iter().find(|(src, _)| *src == path) {
124-
let dest = format!("/{}", dest);
124+
let dest = format!("/{dest}");
125125
match locale {
126126
Locale::Present("en-US") | Locale::NotSpecified => Some(Redirect::permanent(dest)),
127-
Locale::Present(locale) => Some(Redirect::permanent(format!("/{}{}", locale, dest))),
127+
Locale::Present(locale) => Some(Redirect::permanent(format!("/{locale}{dest}"))),
128128
Locale::SpecifiedButMissing => Some(Redirect::temporary(dest)),
129129
}
130130
} else {

src/teams.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ impl Cached for RustTeams {
254254
self.1
255255
}
256256
async fn fetch() -> Result<Self, Box<dyn Error + Send + Sync>> {
257-
let resp: Teams = reqwest::get(format!("{}/teams.json", BASE_URL))
257+
let resp: Teams = reqwest::get(format!("{BASE_URL}/teams.json"))
258258
.await?
259259
.error_for_status()?
260260
.json()
@@ -332,8 +332,8 @@ mod tests {
332332
],
333333
alumni: Vec::new(),
334334
website_data: Some(TeamWebsite {
335-
name: format!("Team {}", name),
336-
description: format!("Description of {}", name),
335+
name: format!("Team {name}"),
336+
description: format!("Description of {name}"),
337337
page: name.into(),
338338
email: None,
339339
repo: None,

templates/components/footer.html.hbs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
<h4>{{fluent "footer-social"}}</h4>
3535
<div class="flex flex-row flex-wrap items-center">
3636
<a rel="me" href="https://social.rust-lang.org/@rust" target="_blank"><img src="/static/images/mastodon.svg"
37-
alt="{{fluent " mastodon"}}" title="{{fluent " mastodon"}}" /></a>
37+
alt="{{fluent "mastodon"}}" title="{{fluent "mastodon"}}" /></a>
3838
<a rel="me" href="https://bsky.app/profile/rust-lang.org" target="_blank"><img
39-
src="/static/images/bluesky.svg" alt="{{fluent " bluesky"}}" title="{{fluent " bluesky"}}" /></a>
39+
src="/static/images/bluesky.svg" alt="{{fluent "bluesky"}}" title="{{fluent "bluesky"}}" /></a>
4040
<a href="https://www.youtube.com/channel/UCaYhcUwRBNscFNUKTjgPFiA" target="_blank"><img class="pv2"
41-
src="/static/images/youtube.svg" alt="{{fluent " footer-alt-youtube"}}" title="YouTube" /></a>
41+
src="/static/images/youtube.svg" alt="{{fluent "footer-alt-youtube"}}" title="YouTube" /></a>
4242
<a href="https://github.com/rust-lang" target="_blank"><img src="/static/images/github.svg" alt="github logo"
43-
title="{{fluent " footer-github-alt"}}" /></a>
43+
title="{{fluent "footer-github-alt"}}" /></a>
4444
</div>
4545
</div>
4646

0 commit comments

Comments
 (0)