Skip to content

Commit

Permalink
chore: print bytes read from stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Nov 5, 2023
1 parent 967e5b1 commit 9572444
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .git-cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ filter_unconventional = true
commit_parsers = [
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Fixes" },
{ message = "^docs", group = "Documentation", skip = true },
]
filter_commits = true
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ct-sct = "0.1"
der = { version = "0.7", features = ["std"] }
hex = "0.4"
itertools = "0.11"
log = "0.4"
memchr = "2.6"
pkcs1 = { version = "0.7", features = ["std"] }
rustls = { version = "0.21", features = ["dangerous_configuration"] }
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(unused)]
#![deny(rust_2018_idioms, future_incompatible)]

use std::{
Expand All @@ -12,7 +11,7 @@ use const_oid::{
db::rfc5912::{ID_EC_PUBLIC_KEY, RSA_ENCRYPTION},
ObjectIdentifier,
};
use der::{Decode as _, DecodePem};
use der::Decode as _;
use itertools::Itertools as _;
use memchr::memmem;
use x509_cert::Certificate;
Expand Down Expand Up @@ -40,7 +39,8 @@ fn main() {
} else if let Some(file) = args.file {
let mut input = if file == "-" {
let mut buf = String::new();
let stdin = io::stdin().read_to_string(&mut buf).unwrap();
let n_bytes = io::stdin().read_to_string(&mut buf).unwrap();
log::trace!("read {n_bytes} from stdin");
Box::new(io::Cursor::new(buf)) as Box<dyn io::BufRead>
} else {
let file = fs::File::open(file).unwrap();
Expand Down

0 comments on commit 9572444

Please sign in to comment.