Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some small clean ups. #10416

Merged
merged 5 commits into from
Feb 24, 2022
Merged

Some small clean ups. #10416

merged 5 commits into from
Feb 24, 2022

Conversation

Eh2406
Copy link
Contributor

@Eh2406 Eh2406 commented Feb 23, 2022

Just some small changes I noticed while exploring the code base.
The only thing nontrivial was noticing that get_registry_index already calls validate_package_name.

@rust-highfive
Copy link

r? @alexcrichton

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 23, 2022
let man_name = file
.file_stem()
.expect("expected filename")
.to_str()
.expect("utf8 filename")
.to_string();
data.insert("man_name".to_string(), man_name);
let data: HashMap<String, String> = [("man_name", man_name)].into();
Copy link
Member

Choose a reason for hiding this comment

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

Could this perhaps be HashMap::from([...]) to avoid the need to have type ascription?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will switch (them all) to that in the morning. It is much clearer.

@@ -344,7 +343,6 @@ pub fn registry_configuration(
// `registry.default` is handled in command-line parsing.
let (index, token, process) = match registry {
Some(registry) => {
validate_package_name(registry, "registry name", "")?;
Copy link
Member

Choose a reason for hiding this comment

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

Was this intentional to be removed? (in isolation I don't know what this is doing and it may no longer be necessary but otherwise it seems out of place for a cleanup-style commit)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I tryed to call it out in the PR:

The only thing nontrivial was noticing that get_registry_index already calls validate_package_name.

So the next line calls this function.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Feb 24, 2022

📌 Commit 6459ce0 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 24, 2022
@bors
Copy link
Contributor

bors commented Feb 24, 2022

⌛ Testing commit 6459ce0 with merge c7dbc42...

@bors
Copy link
Contributor

bors commented Feb 24, 2022

☀️ Test successful - checks-actions
Approved by: alexcrichton
Pushing c7dbc42 to master...

@bors bors merged commit c7dbc42 into rust-lang:master Feb 24, 2022
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Mar 1, 2022
11 changes in
d6cdde584a1f15ea086bae922e20fd27f7165431..3d6970d50e30e797b8e26b2b9b1bdf92dc381f34
2022-02-22 19:55:51 +0000 to 2022-02-28 19:29:07 +0000:

 - rust-lang/cargo#10395
 - rust-lang/cargo#10425
 - rust-lang/cargo#10428
 - rust-lang/cargo#10388
 - rust-lang/cargo#10167
 - rust-lang/cargo#10429
 - rust-lang/cargo#10426
 - rust-lang/cargo#10372
 - rust-lang/cargo#10420
 - rust-lang/cargo#10416
 - rust-lang/cargo#10417
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 1, 2022
Update cargo

11 changes in
d6cdde584a1f15ea086bae922e20fd27f7165431..3d6970d50e30e797b8e26b2b9b1bdf92dc381f34
2022-02-22 19:55:51 +0000 to 2022-02-28 19:29:07 +0000:

 - rust-lang/cargo#10395
 - rust-lang/cargo#10425
 - rust-lang/cargo#10428
 - rust-lang/cargo#10388
 - rust-lang/cargo#10167
 - rust-lang/cargo#10429
 - rust-lang/cargo#10426
 - rust-lang/cargo#10372
 - rust-lang/cargo#10420
 - rust-lang/cargo#10416
 - rust-lang/cargo#10417
@Eh2406 Eh2406 deleted the less_mut branch March 7, 2022 16:42
@ehuss ehuss added this to the 1.61.0 milestone Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants