feat: cosmetic work for the "URL" and "repository" spelling

This commit is contained in:
sxyazi 2025-09-08 22:09:05 +08:00
parent 81a0cf4a1e
commit f46b3006e5
No known key found for this signature in database

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 };