mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-06 20:02:49 +08:00
fix: clippy manual_flatten in skills.rs
This commit is contained in:
@@ -463,13 +463,14 @@ fn custom_skill_roots() -> Vec<(std::path::PathBuf, &'static str)> {
|
|||||||
let cli = std::path::PathBuf::from(&cli_path);
|
let cli = std::path::PathBuf::from(&cli_path);
|
||||||
let cli = std::fs::canonicalize(&cli).unwrap_or(cli);
|
let cli = std::fs::canonicalize(&cli).unwrap_or(cli);
|
||||||
// CLI 可能在 bin/ 子目录或包根目录
|
// CLI 可能在 bin/ 子目录或包根目录
|
||||||
for ancestor in [cli.parent(), cli.parent().and_then(|p| p.parent())] {
|
for pkg_root in [cli.parent(), cli.parent().and_then(|p| p.parent())]
|
||||||
if let Some(pkg_root) = ancestor {
|
.into_iter()
|
||||||
let bundled = pkg_root.join("skills");
|
.flatten()
|
||||||
if bundled.is_dir() && !roots.iter().any(|(dir, _)| dir == &bundled) {
|
{
|
||||||
roots.push((bundled, "OpenClaw 内置"));
|
let bundled = pkg_root.join("skills");
|
||||||
break;
|
if bundled.is_dir() && !roots.iter().any(|(dir, _)| dir == &bundled) {
|
||||||
}
|
roots.push((bundled, "OpenClaw 内置"));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user