Skip to content

Commit 40214f0

Browse files
authored
Merge pull request #994 from pkgw/clippy
Fix everything for Rust 1.67's Clippy
2 parents b4701f5 + e0f4442 commit 40214f0

32 files changed

Lines changed: 127 additions & 142 deletions

File tree

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ fn main() {
99
// they want to spawn off executables.
1010

1111
let target = env::var("TARGET").unwrap();
12-
println!("cargo:rustc-env=TARGET={}", target);
12+
println!("cargo:rustc-env=TARGET={target}");
1313
}

crates/bridge_core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl<'a> CoreBridgeState<'a> {
349349
// `lipsum.ltd.tex` under the name `lipsum.ltd`.
350350

351351
for e in format.extensions() {
352-
let ext = format!("{}.{}", name, e);
352+
let ext = format!("{name}.{e}");
353353

354354
if let FileFormat::Format = format {
355355
match io.input_open_format(&ext, self.status) {

crates/bridge_graphite2/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ fn main() {
5555
""
5656
};
5757

58-
println!("cargo:define_static={}", define_static_flag);
58+
println!("cargo:define_static={define_static_flag}");
5959
}

crates/bundles/src/cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ impl<CB: CacheBackend> CachingBundle<CB> {
461461
// line-based manifest format. Be paranoid and refuse to record such
462462
// filenames.
463463
if !name.contains(|c| c == '\n' || c == '\r') {
464-
writeln!(man, "{} {} {}", name, length, digest_text)?;
464+
writeln!(man, "{name} {length} {digest_text}")?;
465465
}
466466

467467
self.contents.insert(

crates/bundles/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,7 @@ pub fn get_fallback_bundle_url(format_version: u32) -> String {
117117
if format_version < 32 {
118118
"https://relay.fullyjustified.net/default_bundle.tar".to_owned()
119119
} else {
120-
format!(
121-
"https://relay.fullyjustified.net/default_bundle_v{}.tar",
122-
format_version
123-
)
120+
format!("https://relay.fullyjustified.net/default_bundle_v{format_version}.tar")
124121
}
125122
}
126123

crates/dep_support/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ impl<'a, T: Spec> Dependency<'a, T> {
223223
// graphite2 is not available on Debian. So
224224
// let's jump through the hoops of testing
225225
// whether the static archive seems findable.
226-
let libname = format!("lib{}.a", libbase);
226+
let libname = format!("lib{libbase}.a");
227227
state
228228
.libs
229229
.link_paths
@@ -233,11 +233,11 @@ impl<'a, T: Spec> Dependency<'a, T> {
233233
};
234234

235235
let mode = if do_static { "static=" } else { "" };
236-
println!("cargo:rustc-link-lib={}{}", mode, libbase);
236+
println!("cargo:rustc-link-lib={mode}{libbase}");
237237
}
238238

239239
for fw in &state.libs.frameworks {
240-
println!("cargo:rustc-link-lib=framework={}", fw);
240+
println!("cargo:rustc-link-lib=framework={fw}");
241241
}
242242
} else {
243243
// Just let pkg-config do its thing.

crates/engine_spx2html/src/font.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ impl FontData {
406406
// CSS info for the main font.
407407

408408
let rel_url = utf8_percent_encode(&self.basename, CONTROLS).to_string();
409-
let mut rv = vec![(None, format!(r#"url("{}") format("opentype")"#, rel_url))];
409+
let mut rv = vec![(None, format!(r#"url("{rel_url}") format("opentype")"#))];
410410

411411
// Alternates until we're done
412412

@@ -468,7 +468,7 @@ impl FontData {
468468
let rel_url = utf8_percent_encode(&varname, CONTROLS).to_string();
469469
rv.push((
470470
Some(cur_map_index),
471-
format!(r#"url("{}") format("opentype")"#, rel_url),
471+
format!(r#"url("{rel_url}") format("opentype")"#),
472472
));
473473
}
474474

crates/engine_spx2html/src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ impl InitializationState {
333333
let mut ih = None;
334334

335335
for ext in &["", ".otf"] {
336-
texpath = format!("{}{}", name, ext);
336+
texpath = format!("{name}{ext}");
337337

338338
match io.input_open_name(&texpath, common.status) {
339339
OpenResult::Ok(h) => {
@@ -391,7 +391,7 @@ impl InitializationState {
391391

392392
let info = FontInfo {
393393
rel_url: utf8_percent_encode(basename, CONTROLS).to_string(),
394-
family_name: format!("tdux{}", font_num),
394+
family_name: format!("tdux{font_num}"),
395395
family_relation: FamilyRelativeFontId::Regular,
396396
fd_key,
397397
size,
@@ -595,7 +595,7 @@ impl InitializationState {
595595
b.family_name = if let Some(fname) = text.strip_prefix("family-name:") {
596596
fname.to_owned()
597597
} else {
598-
format!("tdux{}", font_num)
598+
format!("tdux{font_num}")
599599
};
600600

601601
// Say that the "regular" font of the first font family definition
@@ -1083,7 +1083,7 @@ impl EmittingState {
10831083
"mfs" => {
10841084
if self.content_finished {
10851085
self.warn_finished_content(
1086-
&format!("manual flexible start tag {:?}", remainder),
1086+
&format!("manual flexible start tag {remainder:?}"),
10871087
common,
10881088
);
10891089
Ok(())
@@ -1095,7 +1095,7 @@ impl EmittingState {
10951095
"me" => {
10961096
if self.content_finished {
10971097
self.warn_finished_content(
1098-
&format!("manual end tag </{}>", remainder),
1098+
&format!("manual end tag </{remainder}>"),
10991099
common,
11001100
);
11011101
} else {
@@ -1484,7 +1484,7 @@ impl EmittingState {
14841484
common: &mut Common,
14851485
) -> Result<()> {
14861486
if self.content_finished {
1487-
self.warn_finished_content(&format!("text `{}`", text), common);
1487+
self.warn_finished_content(&format!("text `{text}`"), common);
14881488
return Ok(());
14891489
}
14901490

@@ -1609,7 +1609,7 @@ impl EmittingState {
16091609
self.current_content.push(' ');
16101610
}
16111611

1612-
write!(self.current_content, "<span style=\"{}\">", font_sel).unwrap();
1612+
write!(self.current_content, "<span style=\"{font_sel}\">").unwrap();
16131613
html_escape::encode_text_to_string(ch_as_str, &mut self.current_content);
16141614
write!(self.current_content, "</span>").unwrap();
16151615
} else {
@@ -2108,7 +2108,7 @@ struct FontInfo {
21082108
impl FontInfo {
21092109
fn selection_style_text(&self, alternate_map_index: Option<usize>) -> String {
21102110
let alt_text = alternate_map_index
2111-
.map(|i| format!("vg{}", i))
2111+
.map(|i| format!("vg{i}"))
21122112
.unwrap_or_default();
21132113

21142114
let extra = match self.family_relation {
@@ -2124,7 +2124,7 @@ impl FontInfo {
21242124

21252125
fn font_face_text(&self, alternate_map_index: Option<usize>) -> String {
21262126
let alt_text = alternate_map_index
2127-
.map(|i| format!("vg{}", i))
2127+
.map(|i| format!("vg{i}"))
21282128
.unwrap_or_default();
21292129

21302130
let extra = match self.family_relation {

crates/errors/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ pub struct AnnotatedMessage {
5252
impl AnnotatedMessage {
5353
/// Set the primary message associated with this annotated report.
5454
pub fn set_message<T: fmt::Display>(&mut self, m: T) {
55-
self.message = format!("{}", m);
55+
self.message = format!("{m}");
5656
}
5757

5858
/// Add an additional note to be associated with this annotated report.
5959
pub fn add_note<T: fmt::Display>(&mut self, n: T) {
60-
self.notes.push(format!("{}", n));
60+
self.notes.push(format!("{n}"));
6161
}
6262

6363
/// Obtain the set of notes associated with this report.

crates/geturl/src/curl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn get_url_generic(
2323

2424
if let Some((start, length)) = range {
2525
let end = start + length as u64 - 1;
26-
handle.range(&format!("{}-{}", start, end))?;
26+
handle.range(&format!("{start}-{end}"))?;
2727
}
2828

2929
let mut buf = Vec::new();

0 commit comments

Comments
 (0)