Skip to content

Commit

Permalink
Remove expect
Browse files Browse the repository at this point in the history
  • Loading branch information
ryardley committed Dec 7, 2024
1 parent b7c268e commit 41a87ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/ciphernode/config/src/app_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ impl RPC {
match self {
RPC::Http(url) | RPC::Https(url) => Ok(url.clone()),
RPC::Ws(url) | RPC::Wss(url) => {
let mut parsed = Url::parse(url).expect(&format!("Failed to parse URL: {}", url));
let mut parsed =
Url::parse(url).context(format!("Failed to parse URL: {}", url))?;
parsed
.set_scheme(if self.is_secure() { "https" } else { "http" })
.map_err(|_| anyhow!("http(s) are valid schemes"))?;
Expand Down
4 changes: 1 addition & 3 deletions packages/ciphernode/enclave_node/src/ciphernode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ pub async fn setup_ciphernode(
config: AppConfig,
address: Address,
) -> Result<(Addr<EventBus>, JoinHandle<Result<()>>, String)> {
let rng = Arc::new(Mutex::new(
rand_chacha::ChaCha20Rng::from_rng(OsRng).expect("Failed to create RNG"),
));
let rng = Arc::new(Mutex::new(rand_chacha::ChaCha20Rng::from_rng(OsRng)?));
let bus = EventBus::new(true).start();
let cipher = Arc::new(Cipher::from_config(&config).await?);
let store = setup_datastore(&config, &bus)?;
Expand Down

0 comments on commit 41a87ba

Please sign in to comment.