chore(examples): Remove relative path from reading data (#1220)

This commit is contained in:
tottoto
2023-01-09 12:47:40 -05:00
committed by GitHub
parent 0ca0630993
commit 1bef5f5757
8 changed files with 25 additions and 15 deletions
+2 -1
View File
@@ -7,7 +7,8 @@ use tonic::transport::{Certificate, Channel, ClientTlsConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let pem = std::fs::read_to_string("examples/data/tls/ca.pem")?;
let data_dir = std::path::PathBuf::from_iter([std::env!("CARGO_MANIFEST_DIR"), "data"]);
let pem = std::fs::read_to_string(data_dir.join("tls/ca.pem"))?;
let ca = Certificate::from_pem(pem);
let tls = ClientTlsConfig::new()