mirror of
https://github.com/warp-tech/warpgate.git
synced 2024-11-10 09:12:56 +08:00
lint
This commit is contained in:
parent
51df7083de
commit
a2bbc1690e
5 changed files with 5 additions and 10 deletions
|
@ -299,7 +299,7 @@ async fn get_auth_state(
|
|||
return None;
|
||||
};
|
||||
|
||||
let Some(state_arc) = store.get(&id) else {
|
||||
let Some(state_arc) = store.get(id) else {
|
||||
return None;
|
||||
};
|
||||
|
||||
|
|
|
@ -193,9 +193,7 @@ pub async fn get_auth_state_for_request(
|
|||
match session.get_auth_state_id() {
|
||||
Some(id) => Ok(store.get(&id.0).ok_or(WarpgateError::InconsistentState)?),
|
||||
None => {
|
||||
let (id, state) = store
|
||||
.create(username, crate::common::PROTOCOL_NAME)
|
||||
.await?;
|
||||
let (id, state) = store.create(username, crate::common::PROTOCOL_NAME).await?;
|
||||
session.set(AUTH_STATE_ID_SESSION_KEY, AuthStateId(id));
|
||||
Ok(state)
|
||||
}
|
||||
|
|
|
@ -185,9 +185,7 @@ impl ProtocolServer for HTTPProtocolServer {
|
|||
let request = poem::Request::builder().uri_str("http://host/").finish();
|
||||
crate::proxy::proxy_normal_request(&request, poem::Body::empty(), &options)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
TargetTestError::ConnectionError(format!("{e}"))
|
||||
})?;
|
||||
.map_err(|e| TargetTestError::ConnectionError(format!("{e}")))?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,8 +105,7 @@ impl SessionStore {
|
|||
|
||||
let services = Data::<&Services>::from_request_without_body(req).await?;
|
||||
let remote_address: &RemoteAddr = <_>::from_request_without_body(req).await?;
|
||||
let session_storage =
|
||||
Data::<&SharedSessionStorage>::from_request_without_body(req).await?;
|
||||
let session_storage = Data::<&SharedSessionStorage>::from_request_without_body(req).await?;
|
||||
|
||||
let (session_handle, mut session_handle_rx) = HttpSessionHandle::new();
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ impl ServiceOutput {
|
|||
#[allow(clippy::indexing_slicing)]
|
||||
let tick = ticks[tick_index];
|
||||
let badge = Colour::Black.on(Colour::Blue).paint(format!(" {} Warpgate connecting ", tick)).to_string();
|
||||
let _ = output_tx.send(Bytes::from([&ERASE_PROGRESS_SPINNER_BUF[..], badge.as_bytes()].concat()));
|
||||
let _ = output_tx.send(Bytes::from([ERASE_PROGRESS_SPINNER_BUF, badge.as_bytes()].concat()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue