use crate::RepoIdResolver; use bobbin_types::search::SearchableRecord; use jacquard_common::DefaultStr; pub trait NormalizeRepoRefs: Sized { fn normalize( self, resolver: &RepoIdResolver, ) -> impl std::future::Future> + Send; } impl NormalizeRepoRefs for SearchableRecord { async fn normalize(self, _resolver: &RepoIdResolver) -> Option { Some(self) } } macro_rules! identity_normalize { ($($t:ty),+ $(,)?) => { $( impl NormalizeRepoRefs for $t { async fn normalize(self, _resolver: &RepoIdResolver) -> Option { Some(self) } } )+ }; } use bobbin_types::org_tangled::actor::profile::Profile; use bobbin_types::org_tangled::feed::comment::Comment as FeedComment; use bobbin_types::org_tangled::feed::reaction::Reaction; use bobbin_types::org_tangled::feed::star::Star; use bobbin_types::org_tangled::git::refs::Refs; use bobbin_types::org_tangled::graph::collaborator::Collaborator; use bobbin_types::org_tangled::graph::follow::Follow; use bobbin_types::org_tangled::graph::vouch::Vouch; use bobbin_types::org_tangled::key::ssh_key::SshKey; use bobbin_types::org_tangled::label::definition::Definition as LabelDefinition; use bobbin_types::org_tangled::repo::artifact::Artifact as RepoArtifact; use bobbin_types::org_tangled::repo::declaration::Declaration; use bobbin_types::org_tangled::repo::manifest::Manifest; use bobbin_types::org_tangled::review::patch::Patch; use bobbin_types::org_tangled::snippet::string::SnippetString; use bobbin_types::org_tangled::track::ticket::Ticket; identity_normalize!( Profile, FeedComment, Reaction, Star, Follow, Vouch, LabelDefinition, SshKey, Manifest, Declaration, Refs, Collaborator, Ticket, Patch, SnippetString, RepoArtifact, );