Skip to content

Conversation

@djc
Copy link
Contributor

@djc djc commented Dec 2, 2025

This seems to compile at least. I still want to give it another look, but happy to get feedback from others, too.

Let me know if/where it needs more comments.

@rami3l
Copy link
Member

rami3l commented Dec 3, 2025

@djc Not directly related, but should we establish a standard for generated files and include src/dist/triple/known.rs?

And, since I cannot compile the code (yet) so I'm not able to verify, maybe it's a good idea to disable rustfmt and/or clippy in the generated files in case anything changes in these two tools?

.unwrap();

code.push_str(&format!(
" CertificateDer::from_slice(&{:?}),\n",
Copy link
Member

Choose a reason for hiding this comment

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

I doubt whether that will give the right formatting. How about disabling formatting and/or lints altogether and just maintaining an OK-ish style here?

use rustls::pki_types::CertificateDer;

pub(crate) const RUSTUP_TRUST_ANCHORS: &[CertificateDer<'static>] = &[
CertificateDer::from_slice(&[
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Since you already have the hostnames, maybe it could be useful to indicate which is which, say with a comment?

let root = verifier.root.lock().unwrap().take().unwrap();
let root_cert = roots
.iter()
.find_map(|(cert_der, ta)| match ta == &root {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: This might be a good place to put .then_some() since the match isn't really doing too much.

.await
.unwrap();

let root = verifier.root.lock().unwrap().take().unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

Nit: That's a lot of .unwrap() here. Maybe this test function return a result and the overall code can be shortened by quite a bit? Not 100% sure, but probably worth testing though (pun intended) :)

@rami3l rami3l mentioned this pull request Dec 6, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants