Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Phani Sajja <[email protected]>
  • Loading branch information
sajjaphani committed Feb 3, 2025
1 parent a9a202e commit cb2344e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions components/core/src/tls/native_tls_wrapper/readers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ fn certs_from_file(file_path: &Path) -> Result<Vec<Certificate>> {
mod tests {
use super::certs_from_file;
use native_tls::Certificate;
use std::io::{Read, Write};
use std::io::Write;
use tempfile::NamedTempFile;

#[test]
Expand All @@ -171,14 +171,8 @@ flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ==
// From der
let mut file = NamedTempFile::new().unwrap();
let cert = Certificate::from_pem(PEM_CERT.as_bytes()).unwrap();
println!("{:?}", cert.to_der());
file.write_all(&cert.to_der().unwrap()).unwrap();
let mut contents = String::new();
file.read_to_string(&mut contents).unwrap();
println!("Contents: {}", contents);
let r = certs_from_file(file.path());
let c = r.unwrap().len();
assert_eq!(c, 1);
assert_eq!(certs_from_file(file.path()).unwrap().len(), 1);

// From single pem
let mut file = NamedTempFile::new().unwrap();
Expand Down

0 comments on commit cb2344e

Please sign in to comment.