Skip to content

Commit f021008

Browse files
committed
refactor(bridge-exec): use AsRef<Path> instead of PathBuf
1 parent 43467d0 commit f021008

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crates/bridge-exec/src/config.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
//! the user running it.
33
44
use core::time;
5-
use std::{fs, io, path::PathBuf};
5+
use std::{
6+
fs, io,
7+
path::{Path, PathBuf},
8+
};
69

710
use alpen_express_primitives::l1::BitcoinAddress;
811
use bitcoin::Network;
@@ -39,7 +42,7 @@ pub struct AddressConfig {
3942

4043
impl Config {
4144
/// Parse the config at the given path and produce the [`Config`].
42-
pub fn load_from_path(path: &PathBuf) -> InitResult<Self> {
45+
pub fn load_from_path(path: impl AsRef<Path>) -> InitResult<Self> {
4346
let contents = fs::read_to_string(path)?;
4447
let config = toml::from_str::<Config>(contents.as_str())
4548
.map_err(|e| SerdeError::new(contents, e))?;

0 commit comments

Comments
 (0)