chore: add workspace clippy lints, release profiles, COMPAT.md, diff-registry.sh

- Workspace clippy lints: or_fun_call, redundant_clone, collection_is_never_read,
  naive_bytecount, stable_sort_primitive, large_types_passed_by_value, assigning_clones
- Fix or_fun_call in cargo_registry.rs (unwrap_or -> unwrap_or_else)
- Release profiles: release (thin LTO) + release-official (full LTO, codegen-units=1)
- COMPAT.md: protocol compatibility matrix for all 7 registries (40 endpoints)
- scripts/diff-registry.sh: differential smoke tests (Docker/npm/Cargo/PyPI/Go/Raw)
This commit is contained in:
2026-04-09 09:04:54 +00:00
parent fda562fe21
commit 0a0131282a
5 changed files with 455 additions and 1 deletions

View File

@@ -448,7 +448,7 @@ async fn publish(State(state): State<Arc<AppState>>, body: Bytes) -> Response {
let features = metadata
.get("features")
.cloned()
.unwrap_or(serde_json::json!({}));
.unwrap_or_else(|| serde_json::json!({}));
let features2 = metadata.get("features2").cloned();
let links = metadata.get("links").cloned();