-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add an example to print trust anchors. #24
Conversation
examples/print-trust-anchors.rs
Outdated
@@ -0,0 +1,29 @@ | |||
// Print the Subject of all extracted trust anchors. |
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.
Should probably be an inner attribute (that is, start with //!
).
examples/print-trust-anchors.rs
Outdated
use std::io::{BufRead, Error}; | ||
use x509_parser::prelude::*; | ||
|
||
struct Printer {} |
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.
For this, makes sense to replace {}
with just ;
.
examples/print-trust-anchors.rs
Outdated
println!("{}", cert.tbs_certificate.subject); | ||
Ok(()) | ||
} | ||
fn load_pem_file(&mut self, rd: &mut dyn BufRead) -> Result<(), Error> { |
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.
Ideally add an empty line between these two methods.
@jsha are you interested in rebasing this for the next release? |
0aa1c18
to
3b23214
Compare
Done! |
Thanks! |
Also remove a
;
that was breaking compile for me.