Skip to content

Commit 271cbc0

Browse files
committed
style: apply rustfmt formatting
1 parent bd87eaa commit 271cbc0

2 files changed

Lines changed: 22 additions & 5 deletions

File tree

src/config.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,10 @@ mod tests {
360360
assert_eq!(back.hotkeys.icons, cfg.hotkeys.icons);
361361
assert_eq!(back.updater.channel, cfg.updater.channel);
362362
assert_eq!(back.profiles.len(), cfg.profiles.len());
363-
assert_eq!(back.window_filter.exclude_processes, cfg.window_filter.exclude_processes);
363+
assert_eq!(
364+
back.window_filter.exclude_processes,
365+
cfg.window_filter.exclude_processes
366+
);
364367
}
365368

366369
#[test]

src/updater.rs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,10 @@ fn hash_from_sums(sums: &str, filename: &str) -> Option<String> {
150150
};
151151
// sha256sum may prefix the name with '*'; also tolerate path components.
152152
let name = parts.next().unwrap_or("").trim_start_matches('*');
153-
let base = name.rsplit(|c| c == '/' || c == '\\').next().unwrap_or(name);
153+
let base = name
154+
.rsplit(|c| c == '/' || c == '\\')
155+
.next()
156+
.unwrap_or(name);
154157
if base == filename {
155158
return Some(hash.to_lowercase());
156159
}
@@ -167,14 +170,22 @@ fn resolve_expected_hash(
167170
) -> Option<String> {
168171
let sidecar = format!("{}.sha256", zip_name);
169172
if let Some(a) = assets.iter().find(|a| a.name == sidecar) {
170-
if let Ok(text) = client.get(&a.browser_download_url).send().and_then(|r| r.text()) {
173+
if let Ok(text) = client
174+
.get(&a.browser_download_url)
175+
.send()
176+
.and_then(|r| r.text())
177+
{
171178
if let Some(h) = text.split_whitespace().next() {
172179
return Some(h.to_lowercase());
173180
}
174181
}
175182
}
176183
if let Some(a) = assets.iter().find(|a| a.name == "SHA256SUMS.txt") {
177-
if let Ok(text) = client.get(&a.browser_download_url).send().and_then(|r| r.text()) {
184+
if let Ok(text) = client
185+
.get(&a.browser_download_url)
186+
.send()
187+
.and_then(|r| r.text())
188+
{
178189
return hash_from_sums(&text, zip_name);
179190
}
180191
}
@@ -410,6 +421,9 @@ cccc3333 SHA256SUMS-decoy.zip
410421
#[test]
411422
fn hash_from_sums_tolerates_star_and_blank_lines() {
412423
let sums = "\n DEAFBEEF *file.zip\n\n";
413-
assert_eq!(hash_from_sums(sums, "file.zip").as_deref(), Some("deafbeef"));
424+
assert_eq!(
425+
hash_from_sums(sums, "file.zip").as_deref(),
426+
Some("deafbeef")
427+
);
414428
}
415429
}

0 commit comments

Comments
 (0)