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),+) => {