Skip to content

Commit cf4d625

Browse files
committed
Clippy🌈
1 parent 3a8ab32 commit cf4d625

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

src/misc/ini_file_system.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl IniFileSection {
124124
pub fn write_section<W: std::fmt::Write>(&self, writer: &mut W) {
125125
writeln!(writer, "[{}]", self.name).unwrap();
126126
for (key, value) in &self.options {
127-
writeln!(writer, "{}={}", key, value).unwrap();
127+
writeln!(writer, "{key}={value}").unwrap();
128128
}
129129
writeln!(writer).unwrap();
130130
}
@@ -223,7 +223,7 @@ impl IniFile {
223223

224224
pub fn write_ini_file<W: std::fmt::Write>(&self, writer: &mut W) {
225225
if let Some(description) = &self.description {
226-
writeln!(writer, "# {}", description).unwrap();
226+
writeln!(writer, "# {description}").unwrap();
227227
writeln!(writer, "\n# -----------------------------------------------------------------------------\n", ).unwrap();
228228
}
229229
for include in &self.includes {
@@ -239,7 +239,7 @@ impl IniFile {
239239
}
240240
}
241241
for console_cmd in &self.console_cmds {
242-
writeln!(writer, "ConsoleCmd {}", console_cmd).unwrap();
242+
writeln!(writer, "ConsoleCmd {console_cmd}").unwrap();
243243
}
244244
}
245245
}

src/misc/resource_id.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl FromStr for ResourceID {
4444
};
4545

4646
Ok(Self {
47-
uri: rid.uri.replace(format!("{}_", CONSOLE_TAG).as_str(), ""),
47+
uri: rid.uri.replace(format!("{CONSOLE_TAG}_").as_str(), ""),
4848
})
4949
}
5050
}
@@ -69,7 +69,7 @@ impl ResourceID {
6969
pub fn create_derived(&self, parameters: &str, extension: &str) -> ResourceID {
7070
let mut derived = format!("[{}]", self.uri);
7171
if !parameters.is_empty() {
72-
derived += format!("({})", parameters).as_str();
72+
derived += format!("({parameters})").as_str();
7373
}
7474
derived += ".";
7575
if !extension.is_empty() {

src/resource/pdefs/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ impl PartitionId {
7373
match patch_index {
7474
PatchId::Base => {
7575
let base = self.to_string();
76-
format!("{}.rpkg", base)
76+
format!("{base}.rpkg")
7777
}
7878
PatchId::Patch(patch_idx) => {
7979
let base = self.to_string();
80-
format!("{}patch{}.rpkg", base, patch_idx)
80+
format!("{base}patch{patch_idx}.rpkg")
8181
}
8282
}
8383
}
@@ -131,8 +131,7 @@ impl FromStr for PartitionId {
131131
});
132132
}
133133
Err(PartitionIdError::ParsingError(format!(
134-
"Unable to parse {} to a partitionId",
135-
id
134+
"Unable to parse {id} to a partitionId"
136135
)))
137136
}
138137
}
@@ -156,7 +155,7 @@ impl Display for PartitionId {
156155
format!("dlc{}lang{}", self.index, lang)
157156
}
158157
};
159-
write!(f, "{}", str)
158+
write!(f, "{str}")
160159
}
161160
}
162161

0 commit comments

Comments
 (0)