syscare/0036-syscare-abi-fix-clippy-warnings.patch

50 lines
2.0 KiB
Diff
Raw Permalink Normal View History

From 855794af7d0b932a704b1498a30e7c7f9d009eeb Mon Sep 17 00:00:00 2001
From: renoseven <dev@renoseven.net>
Date: Sat, 29 Jun 2024 17:03:30 +0800
Subject: [PATCH] syscare-abi: fix clippy warnings
Signed-off-by: renoseven <dev@renoseven.net>
---
syscare-abi/src/patch_info.rs | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/syscare-abi/src/patch_info.rs b/syscare-abi/src/patch_info.rs
index 65f7664..9108a89 100644
--- a/syscare-abi/src/patch_info.rs
+++ b/syscare-abi/src/patch_info.rs
@@ -77,21 +77,17 @@ impl std::fmt::Display for PatchInfo {
writeln!(f, "target: {}", self.target.short_name())?;
writeln!(f, "license: {}", self.target.license)?;
writeln!(f, "description: {}", self.description)?;
- if !self.entities.is_empty() {
- writeln!(f, "entities:")?;
- for (entity_idx, entity) in self.entities.iter().enumerate() {
- writeln!(f, "* {}", entity.patch_name.to_string_lossy())?;
- }
+ writeln!(f, "entities:")?;
+ for entity in &self.entities {
+ writeln!(f, "* {}", entity.patch_name.to_string_lossy())?;
}
-
- if !self.patches.is_empty() {
- writeln!(f, "patches:")?;
- let last_idx = self.patches.len() - 1;
- for (patch_idx, patch_file) in self.patches.iter().enumerate() {
- match patch_idx == last_idx {
- false => writeln!(f, "* {}", patch_file.name.to_string_lossy())?,
- true => write!(f, "* {}", patch_file.name.to_string_lossy())?,
- }
+ writeln!(f, "patches:")?;
+ let last_idx = self.patches.len() - 1;
+ for (idx, patch) in self.patches.iter().enumerate() {
+ if idx == last_idx {
+ write!(f, "* {}", patch.name.to_string_lossy())?
+ } else {
+ writeln!(f, "* {}", patch.name.to_string_lossy())?
}
}
--
2.34.1