@@ -125,7 +125,7 @@ fn baseurl(lang: &str) -> String {
125
125
if lang == "en-US" {
126
126
String :: new ( )
127
127
} else {
128
- format ! ( "/{}" , lang )
128
+ format ! ( "/{lang}" )
129
129
}
130
130
}
131
131
@@ -274,13 +274,13 @@ fn hash_css(css: &str) -> String {
274
274
}
275
275
276
276
fn compile_sass ( filename : & str ) -> String {
277
- let scss_file = format ! ( "./src/styles/{}.scss" , filename ) ;
277
+ let scss_file = format ! ( "./src/styles/{filename }.scss" ) ;
278
278
279
279
let css = compile_file ( & scss_file, Options :: default ( ) )
280
280
. unwrap_or_else ( |_| panic ! ( "couldn't compile sass: {}" , & scss_file) ) ;
281
281
282
282
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" ) ;
284
284
285
285
fs:: write ( & css_file, css. into_bytes ( ) )
286
286
. unwrap_or_else ( |_| panic ! ( "couldn't write css file: {}" , & css_file) ) ;
@@ -291,7 +291,7 @@ fn compile_sass(filename: &str) -> String {
291
291
fn concat_vendor_css ( files : Vec < & str > ) -> String {
292
292
let mut concatted = String :: new ( ) ;
293
293
for filestem in files {
294
- let vendor_path = format ! ( "./static/styles/{}.css" , filestem ) ;
294
+ let vendor_path = format ! ( "./static/styles/{filestem }.css" ) ;
295
295
let contents = fs:: read_to_string ( vendor_path) . expect ( "couldn't read vendor css" ) ;
296
296
concatted. push_str ( & contents) ;
297
297
}
@@ -307,7 +307,7 @@ fn concat_vendor_css(files: Vec<&str>) -> String {
307
307
fn concat_app_js ( files : Vec < & str > ) -> String {
308
308
let mut concatted = String :: new ( ) ;
309
309
for filestem in files {
310
- let vendor_path = format ! ( "./static/scripts/{}.js" , filestem ) ;
310
+ let vendor_path = format ! ( "./static/scripts/{filestem }.js" ) ;
311
311
let contents = fs:: read_to_string ( vendor_path) . expect ( "couldn't read app js" ) ;
312
312
concatted. push_str ( & contents) ;
313
313
}
@@ -354,7 +354,7 @@ async fn render_governance(
354
354
Ok ( Template :: render ( page, context) )
355
355
}
356
356
Err ( err) => {
357
- eprintln ! ( "error while loading the governance page: {}" , err ) ;
357
+ eprintln ! ( "error while loading the governance page: {err}" ) ;
358
358
Err ( Status :: InternalServerError )
359
359
}
360
360
}
@@ -377,7 +377,7 @@ async fn render_team(
377
377
if err. is :: < teams:: TeamNotFound > ( ) {
378
378
Err ( Status :: NotFound )
379
379
} else {
380
- eprintln ! ( "error while loading the team page: {}" , err ) ;
380
+ eprintln ! ( "error while loading the team page: {err}" ) ;
381
381
Err ( Status :: InternalServerError )
382
382
}
383
383
}
@@ -392,7 +392,7 @@ fn render_subject(category: Category, subject: &str, lang: String) -> Result<Tem
392
392
// To work around the problem we check whether the template exists beforehand.
393
393
let path = Path :: new ( "templates" )
394
394
. join ( category. name ( ) )
395
- . join ( format ! ( "{}.html.hbs" , subject ) ) ;
395
+ . join ( format ! ( "{subject }.html.hbs" ) ) ;
396
396
if !path. is_file ( ) {
397
397
return Err ( Status :: NotFound ) ;
398
398
}
0 commit comments