Skip to content

Commit bd8e9c6

Browse files
committed
Cargo fmt
1 parent 6b33aac commit bd8e9c6

4 files changed

Lines changed: 22 additions & 13 deletions

File tree

‎src/cleanup_modules/device_cleanup.rs‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,11 @@ impl Dumper for DeviceDumper {
156156
}
157157
}
158158

159-
async fn dump_filtered<F: Fn(&Device) -> bool>(state: &State, output_file: &str, filter_fn: F) -> Result<(), ModuleError> {
159+
async fn dump_filtered<F: Fn(&Device) -> bool>(
160+
state: &State,
161+
output_file: &str,
162+
filter_fn: F,
163+
) -> Result<(), ModuleError> {
160164
let inf_regex = Regex::new(r"^oem[0-9]+\.inf$").unwrap();
161165
let devices: Vec<Device> = enumerate_devices()
162166
.into_module_report(DEVICE_MODULE_NAME)?
@@ -165,8 +169,7 @@ async fn dump_filtered<F: Fn(&Device) -> bool>(state: &State, output_file: &str,
165169
.filter(filter_fn)
166170
.collect();
167171

168-
let file_path =
169-
get_path_to_dump(state, output_file).into_module_report(DEVICE_MODULE_NAME)?;
172+
let file_path = get_path_to_dump(state, output_file).into_module_report(DEVICE_MODULE_NAME)?;
170173
let dump_file = create_dump_file(&file_path).into_module_report(DEVICE_MODULE_NAME)?;
171174
let file_name = file_path.as_path().to_str().unwrap();
172175

‎src/cleanup_modules/driver_cleanup.rs‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,18 @@ impl Dumper for DriverDumper {
132132
}
133133
}
134134

135-
async fn dump_filtered<F: Fn(&Driver) -> bool>(state: &State, output_file: &str, filter_fn: F) -> Result<(), ModuleError> {
135+
async fn dump_filtered<F: Fn(&Driver) -> bool>(
136+
state: &State,
137+
output_file: &str,
138+
filter_fn: F,
139+
) -> Result<(), ModuleError> {
136140
let drivers: Vec<Driver> = enumerate_drivers()
137141
.into_module_report(DRIVER_MODULE_NAME)?
138142
.into_iter()
139143
.filter(filter_fn)
140144
.collect();
141145

142-
let file_path =
143-
get_path_to_dump(state, output_file).into_module_report(DRIVER_MODULE_NAME)?;
146+
let file_path = get_path_to_dump(state, output_file).into_module_report(DRIVER_MODULE_NAME)?;
144147
let dump_file = create_dump_file(&file_path).into_module_report(DRIVER_MODULE_NAME)?;
145148
let file_name = file_path.as_path().to_str().unwrap();
146149

‎src/cleanup_modules/driver_package_cleanup.rs‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,18 @@ impl Dumper for DriverPackageDumper {
158158
}
159159
}
160160

161-
async fn dump_filtered<F: Fn(&DriverPackage) -> bool>(state: &State, output_file: &str, filter_fn: F) -> Result<(), ModuleError> {
161+
async fn dump_filtered<F: Fn(&DriverPackage) -> bool>(
162+
state: &State,
163+
output_file: &str,
164+
filter_fn: F,
165+
) -> Result<(), ModuleError> {
162166
let driver_packages: Vec<DriverPackage> = enumerate_driver_packages()
163167
.into_module_report(MODULE_NAME)?
164168
.into_iter()
165169
.filter(filter_fn)
166170
.collect();
167171

168-
let file_path =
169-
get_path_to_dump(state, output_file).into_module_report(MODULE_NAME)?;
172+
let file_path = get_path_to_dump(state, output_file).into_module_report(MODULE_NAME)?;
170173
let dump_file = create_dump_file(&file_path).into_module_report(MODULE_NAME)?;
171174
let file_name = file_path.as_path().to_str().unwrap();
172175

@@ -177,9 +180,7 @@ async fn dump_filtered<F: Fn(&DriverPackage) -> bool>(state: &State, output_file
177180

178181
serde_json::to_writer_pretty(dump_file, &driver_packages)
179182
.into_report()
180-
.attach_printable_lazy(|| {
181-
format!("failed to dump driver packages into '{}'", file_name)
182-
})
183+
.attach_printable_lazy(|| format!("failed to dump driver packages into '{}'", file_name))
183184
.into_module_report(MODULE_NAME)?;
184185

185186
match driver_packages.len() {

‎src/services/regex_cache.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ pub fn cached_match(input: Option<&str>, regex_pattern: Option<&str>) -> bool {
2626
Some(regex) => regex,
2727
None => {
2828
let regex = build_regex(regex_pattern);
29-
let Entry::Vacant(vacant) = cache.entry(regex_pattern.to_string()) else { unreachable!() };
29+
let Entry::Vacant(vacant) = cache.entry(regex_pattern.to_string()) else {
30+
unreachable!()
31+
};
3032
vacant.insert(regex)
3133
}
3234
}

0 commit comments

Comments
 (0)