-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Some small clean ups. #10416
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Some small clean ups. #10416
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
crates/mdman/src/hbs.rs
Outdated
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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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", "")?; |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
@bors: r+ |
📌 Commit 6459ce0 has been approved by |
☀️ Test successful - checks-actions |
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
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
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.