DEVELOPMENT ENVIRONMENT

~liljamo/canwa

60c74f2588d75041cbdf1f111d51487512cf4f17 — Jonni Liljamo 10 days ago 5e38656
feat: return result from service new
3 files changed, 11 insertions(+), 5 deletions(-)

M src/service/gotify.rs
M src/service/matrix.rs
M src/service/mod.rs
M src/service/gotify.rs => src/service/gotify.rs +5 -2
@@ 35,8 35,11 @@ pub struct GotifyService {
}

impl GotifyService {
    pub fn new(client: reqwest::Client, config: GotifyConfig) -> Self {
        Self { client, config }
    pub fn new(
        client: reqwest::Client,
        config: GotifyConfig,
    ) -> Result<Self, Box<dyn std::error::Error>> {
        Ok(Self { client, config })
    }
}


M src/service/matrix.rs => src/service/matrix.rs +5 -2
@@ 40,8 40,11 @@ pub struct MatrixService {
}

impl MatrixService {
    pub fn new(client: reqwest::Client, config: MatrixConfig) -> Self {
        Self { client, config }
    pub fn new(
        client: reqwest::Client,
        config: MatrixConfig,
    ) -> Result<Self, Box<dyn std::error::Error>> {
        Ok(Self { client, config })
    }

    fn gen_txn_id(&self) -> String {

M src/service/mod.rs => src/service/mod.rs +1 -1
@@ 27,7 27,7 @@ macro_rules! make_service_match {
                    .as_any()
                    .downcast_ref::<$service::[<$service:upper_camel Config>]>()
                    .ok_or("no such service")?.clone(),
            ))
            )?)
        }
    };
    ($client:expr, $service_config:expr, $($service:expr),+) => {