feat: cosmetic work for the "URL" and "repository" spelling (#3152)

This commit is contained in:
三咲雅 misaki masa 2025-09-08 22:09:49 +08:00 committed by GitHub
parent 81a0cf4a1e
commit fa0e7e62c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -67,11 +67,11 @@ impl FromStr for Dependency {
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
let mut parts = s.splitn(2, ':');
let Some(parent) = parts.next() else { bail!("Package url cannot be empty") };
let Some(parent) = parts.next() else { bail!("Package URL cannot be empty") };
let child = parts.next().unwrap_or_default();
let Some((_, repo)) = parent.split_once('/') else {
bail!("Package url `{parent}` must be in the format `owner/repo`")
bail!("Package URL `{parent}` must be in the format `owner/repository`")
};
let name = if child.is_empty() { repo } else { child };