Remove unsafe
This commit is contained in:
parent
94ac2d8818
commit
ac67c52bee
1 changed files with 3 additions and 3 deletions
|
@ -62,12 +62,11 @@ async fn main() -> Result<!, Error> {
|
||||||
);
|
);
|
||||||
|
|
||||||
let tcp_bind = TcpListener::bind(config.addr).await?;
|
let tcp_bind = TcpListener::bind(config.addr).await?;
|
||||||
let secret: &'static String =
|
|
||||||
unsafe { core::mem::transmute::<&String, &'static String>(&config.secret) };
|
|
||||||
let value_tx = Arc::new(Mutex::new(value_tx));
|
let value_tx = Arc::new(Mutex::new(value_tx));
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let value_tx = value_tx.clone();
|
let value_tx = value_tx.clone();
|
||||||
|
let secret = config.secret.clone();
|
||||||
|
|
||||||
tokio::select! {
|
tokio::select! {
|
||||||
_ = client.next() => (),
|
_ = client.next() => (),
|
||||||
|
@ -79,8 +78,9 @@ async fn main() -> Result<!, Error> {
|
||||||
.timer(TokioTimer::new())
|
.timer(TokioTimer::new())
|
||||||
.serve_connection(io, service_fn(|request| {
|
.serve_connection(io, service_fn(|request| {
|
||||||
let value_tx = value_tx.clone();
|
let value_tx = value_tx.clone();
|
||||||
|
let secret = secret.clone();
|
||||||
async move {
|
async move {
|
||||||
hooks(request, secret, value_tx).await
|
hooks(request, &secret, value_tx).await
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
.await
|
.await
|
||||||
|
|
Loading…
Reference in a new issue