mirror of
https://github.com/rust-lang/cargo
synced 2024-09-13 21:11:44 +00:00
refactor(util-schemas): remove unused arg
This commit is contained in:
parent
f1216495bb
commit
d1e1c3d0aa
|
@ -1176,7 +1176,7 @@ str_newtype!(PackageName);
|
|||
impl<T: AsRef<str>> PackageName<T> {
|
||||
/// Validated package name
|
||||
pub fn new(name: T) -> Result<Self, NameValidationError> {
|
||||
restricted_names::validate_package_name(name.as_ref(), "package name", "")?;
|
||||
restricted_names::validate_package_name(name.as_ref(), "package name")?;
|
||||
Ok(Self(name))
|
||||
}
|
||||
}
|
||||
|
@ -1198,7 +1198,7 @@ str_newtype!(RegistryName);
|
|||
impl<T: AsRef<str>> RegistryName<T> {
|
||||
/// Validated registry name
|
||||
pub fn new(name: T) -> Result<Self, NameValidationError> {
|
||||
restricted_names::validate_package_name(name.as_ref(), "registry name", "")?;
|
||||
restricted_names::validate_package_name(name.as_ref(), "registry name")?;
|
||||
Ok(Self(name))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ pub enum NameValidationError {
|
|||
/// level of sanity. Note that package names have other restrictions
|
||||
/// elsewhere. `cargo new` has a few restrictions, such as checking for
|
||||
/// reserved names. crates.io has even more restrictions.
|
||||
pub fn validate_package_name(name: &str, what: &'static str, help: &str) -> Result<()> {
|
||||
pub fn validate_package_name(name: &str, what: &'static str) -> Result<()> {
|
||||
if name.is_empty() {
|
||||
return Err(NameValidationError::Empty(what));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue