Make token config mandatory
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
d0cb431546
commit
2ef603151e
2 changed files with 5 additions and 5 deletions
|
|
@ -58,7 +58,7 @@ struct Config {
|
|||
|
||||
/// Token to match the one provided by the Webhook service
|
||||
#[serde(rename = "webhook-token")]
|
||||
webhook_token: Option<String>,
|
||||
webhook_token: String,
|
||||
|
||||
/// HTTP Webhook listening address and port, e.g., 127.0.0.1:1234 or [::1]:1234
|
||||
#[serde(default = "default_addr")]
|
||||
|
|
@ -140,8 +140,8 @@ async fn main() -> Result<!, Error> {
|
|||
);
|
||||
|
||||
let tcp_bind = TcpListener::bind(config.addr).await?;
|
||||
let token: Option<&'static String> =
|
||||
unsafe { core::mem::transmute(config.webhook_token.as_ref()) };
|
||||
let token: &'static String =
|
||||
unsafe { core::mem::transmute::<&String, &'static String>(&config.webhook_token) };
|
||||
let value_tx = Arc::new(Mutex::new(value_tx));
|
||||
|
||||
loop {
|
||||
|
|
|
|||
Loading…
Reference in a new issue