feat: migrate utils::config from anyhow to thiserror and handle a "single config init" mechanism
This commit is contained in:
@ -9,7 +9,7 @@ use thiserror::Error;
|
||||
use crate::cps::lire_carte;
|
||||
use crate::libssv::{SSV_InitLIB2, SSV_LireConfig};
|
||||
|
||||
use ::utils::config::load_config;
|
||||
use ::utils::config::{load_config, ConfigError};
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum SSVDemoError {
|
||||
@ -18,7 +18,7 @@ pub enum SSVDemoError {
|
||||
#[error(transparent)]
|
||||
SSVLibErrorCode(#[from] crate::libssv::LibSSVError),
|
||||
#[error(transparent)]
|
||||
Anyhow(#[from] anyhow::Error),
|
||||
Configuration(#[from] ConfigError),
|
||||
}
|
||||
|
||||
fn ssv_init_lib_2() -> Result<(), SSVDemoError> {
|
||||
@ -71,7 +71,7 @@ pub fn demo() -> Result<(), SSVDemoError> {
|
||||
|
||||
println!("------- Demo for the SSV library --------");
|
||||
|
||||
load_config()?;
|
||||
load_config(None)?;
|
||||
|
||||
ssv_init_lib_2()?;
|
||||
|
||||
|
Reference in New Issue
Block a user