Skip to content

Commit

Permalink
Use fs_err
Browse files Browse the repository at this point in the history
  • Loading branch information
kvinwang committed Oct 24, 2024
1 parent a24ad65 commit 3d0e953
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
26 changes: 20 additions & 6 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 certgen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ edition = "2021"
anyhow = "1.0.89"
clap = { version = "4.5.18", features = ["derive"] }
ra-tls = { version = "0.1.0", path = "../ra-tls" }
fs-err = "3.0.0"
5 changes: 3 additions & 2 deletions certgen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use ra_tls::{
cert::CertRequest,
rcgen::{KeyPair, PKCS_ECDSA_P256_SHA256},
};
use fs_err as fs;

#[derive(Parser)]
#[command(author, version, about)]
Expand Down Expand Up @@ -80,7 +81,7 @@ fn main() -> anyhow::Result<()> {
fn store_cert(path: &str, name: &str, cert: &str, key: &str) -> anyhow::Result<()> {
let cert_path = format!("{}/{}.cert", path, name);
let key_path = format!("{}/{}.key", path, name);
std::fs::write(cert_path, cert)?;
std::fs::write(key_path, key)?;
fs::write(cert_path, cert)?;
fs::write(key_path, key)?;
Ok(())
}
1 change: 1 addition & 0 deletions kms/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ scale = { version = "3.6.12", package = "parity-scale-codec", features = ["deriv

[build-dependencies]
prpc-build = "0.2.1"
fs-err = "3.0.0"
4 changes: 3 additions & 1 deletion kms/rpc/build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use fs_err as fs;

fn main() {
let out_dir = "./src/generated";

std::fs::create_dir_all(out_dir).expect("failed to create out dir");
fs::create_dir_all(out_dir).expect("failed to create out dir");

let mut builder = prpc_build::configure()
.out_dir(out_dir)
Expand Down

0 comments on commit 3d0e953

Please sign in to comment.