faucet/src/main -> update db_path with std::path

This commit is contained in:
Sombra
2023-03-02 11:57:34 -08:00
committed by parazyd
parent 9d74f60083
commit 8da4b7ecb3

View File

@@ -16,7 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use std::{collections::HashMap, path::PathBuf, str::FromStr};
use std::{
collections::HashMap,
path::{Path, PathBuf},
str::FromStr,
};
use async_std::{
stream::StreamExt,
@@ -549,7 +553,8 @@ async fn realmain(args: Args, ex: Arc<smol::Executor<'_>>) -> Result<()> {
// Initialize or open sled database
// TODO: Use proper OsPath here, not {}/{}
let db_path = format!("{}/{}", expand_path(&args.database)?.to_str().unwrap(), args.chain);
let db_path =
Path::new(expand_path(&args.database)?.to_str().unwrap()).join(args.chain.clone());
let sled_db = sled::open(&db_path)?;
// Initialize validator state