Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

fix: do now allow empty spec name #63

Merged
merged 2 commits into from
Dec 11, 2023
Merged

Conversation

Rustin170506
Copy link
Owner

See the test case. We shouldn't allow empty name.

@Rustin170506
Copy link
Owner Author

I've filed rust-lang/cargo#13152 to fix the bug from the upstream.

Copy link
Owner Author

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔢 Self-check

@@ -102,6 +102,13 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
.map(String::as_str)
.unwrap();
let spec = PackageIdSpec::parse(package)?;
if spec.name().is_empty() {
return Err(CliError::new(
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied from cargo. So I guess it is the correct way to bail out an error with the error code.

@Rustin170506 Rustin170506 merged commit 9990169 into main Dec 11, 2023
9 checks passed
@Rustin170506 Rustin170506 deleted the rustin-patch-empty-name branch December 11, 2023 02:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant