refactor(site): drop site_id_from_key, split the key at its caller

site_id_from_key split the prefix out and then walked the registry to confirm the prefix was a registered site id — a round trip over a value cache_key itself produced from that registry: the unknown and no-colon branches were unreachable for any key the bot makes. The single caller (the link-cache hit path) splits the prefix directly; the registry-echo test and the misskey assertion of it go with it.
This commit is contained in:
2026-09-24 04:06:13 +08:00
parent f984428169
commit 022f63916c
3 changed files with 4 additions and 26 deletions
@@ -209,7 +209,6 @@ mod tests {
cache_key("https://misskey.io/notes/aotihl10lqrs015s"),
Some("misskey:aotihl10lqrs015s".to_string())
);
assert_eq!(crate::site::site_id_from_key("misskey:abc"), "misskey");
}
#[test]