fix(app-iced,presenter): 修 clippy -D warnings 抓到的三处(文档注释位置、manual_range_contains、单元素 for)
1. view.rs:我删掉手写 `LOADERS` 常量后,那段文档注释落到了 `VERSION_ROWS` 头上并留了空行 (clippy::empty_line_after_doc_comments)。说明本身是给「chip 顺序为什么委派」用的, 改成普通 `//` 注释,不冒充某个条目的文档。 2. model.rs:LiteLoader 的版本区间判定改成 `((1, 5, 2)..=(1, 12, 2)).contains(&version)` (clippy::manual_range_contains),语义一字未变。 3. install_tests.rs:只剩 OptiFine 一家后,单元素 `for` 改成直调(clippy::single_element_loop)。
This commit is contained in:
1 parent
3114fa2d4f
commit
04a123deab
3 files changed
+11
-14
No files matched your search
@@ -149,7 +149,7 @@ impl Loader {
|
||||
// LiteLoader 官方版本表只到 1.12.2(最老 1.5.2),两头都是「官方没有构建」。
|
||||
// 预览版/快照同样没有(那 16 个原版版本全是正式版)。
|
||||
Loader::LiteLoader => match rank {
|
||||
Some(version) if version >= (1, 5, 2) && version <= (1, 12, 2) => Ok(()),
|
||||
Some(version) if ((1, 5, 2)..=(1, 12, 2)).contains(&version) => Ok(()),
|
||||
_ => Err(Incompat::Unsupported),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -47,13 +47,11 @@ use super::super::frame;
|
||||
use super::super::Message;
|
||||
use super::model::{Loader, LoaderVersionsView, OptionsView};
|
||||
|
||||
/// 加载器 chip 的顺序与集合**委派**给 [`Loader::ALL`](原版 / Forge / NeoForge / Fabric /
|
||||
/// Quilt / LiteLoader)。
|
||||
///
|
||||
/// 这里原先是手写的五枚常量——那是同一份清单的第三处副本(`dto::wizard_choices`、
|
||||
/// `Loader::ALL`、这里),M222 加 LiteLoader 时三处都要改,索性改成委派。
|
||||
/// ⚠️ **宽度需 D30 视觉复验**:五枚 chip 实测合计约 311 dp(正文列 424),第六枚(LiteLoader)
|
||||
/// 估算约 +50 dp,理论仍在一行内,但这是估算不是实测——本轮无构建槽位,未出浅/深色截图。
|
||||
// 加载器 chip 的顺序与集合**委派**给 `Loader::ALL`(原版 / Forge / NeoForge / Fabric /
|
||||
// Quilt / LiteLoader)。这里原先是手写的五枚常量——同一份清单的第三处副本
|
||||
// (`dto::wizard_choices`、`Loader::ALL`、这里),M222 加 LiteLoader 时三处都得改,索性委派。
|
||||
// ⚠️ 宽度需 D30 视觉复验:五枚 chip 实测合计约 311 dp(正文列 424),第六枚估算 +50 dp,
|
||||
// 理论仍在行内,但那是估算不是实测(本轮无看图通道,未出浅/深色截图)。
|
||||
|
||||
/// 菜单项高度 = 48(`MenuGeometry` 的项高)×2 行 + 上下留白 8×2 = 112。
|
||||
/// 这么算是为了避免「列表被截掉半行」——滚动区高度必须覆盖整行。
|
||||
|
||||
@@ -149,12 +149,11 @@ fn loader_support_matrix_is_explicit() {
|
||||
assert!(supported(kind), "{} 应当受支持", kind.label());
|
||||
}
|
||||
// OptiFine 仍没有安装管线(要跑外部 Patcher + 原地改 zip),显式拒装并说清可替代做法。
|
||||
for kind in [LoaderKind::OptiFine] {
|
||||
assert!(!supported(kind), "{} 不该被当成可装", kind.label());
|
||||
let reason = unsupported_reason(kind);
|
||||
assert!(reason.contains(kind.label()), "{reason}");
|
||||
assert!(reason.contains("还没有接入"), "{reason}");
|
||||
}
|
||||
let optifine = LoaderKind::OptiFine;
|
||||
assert!(!supported(optifine), "{} 不该被当成可装", optifine.label());
|
||||
let reason = unsupported_reason(optifine);
|
||||
assert!(reason.contains(optifine.label()), "{reason}");
|
||||
assert!(reason.contains("还没有接入"), "{reason}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user