use objectiveai_sdk::{RemotePath, RemotePathCommitOptional};
pub fn favorite_matches_path(
fav_path: &RemotePathCommitOptional,
path: &RemotePath,
) -> bool {
match (fav_path, path) {
(
RemotePathCommitOptional::Github {
owner: fo,
repository: fr,
commit: fc,
},
RemotePath::Github {
owner: po,
repository: pr,
commit: pc,
},
) => fo == po && fr == pr && fc.as_ref().is_none_or(|c| c == pc),
(
RemotePathCommitOptional::Filesystem {
owner: fo,
repository: fr,
commit: fc,
},
RemotePath::Filesystem {
owner: po,
repository: pr,
commit: pc,
},
) => fo == po && fr == pr && fc.as_ref().is_none_or(|c| c == pc),
(
RemotePathCommitOptional::Mock { name: fn_ },
RemotePath::Mock { name: pn },
) => fn_ == pn,
_ => false,
}
}