mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-08 13:10:03 +00:00
Optimization: Box fut Remote::get_redirected_final_url
in GhCrateMeta::find
(#600)
* Box fut `Remote::get_redirected_final_url` in `GhCrateMeta::find` Since the other await point in `GhCrateMeta::find` only needs `Arc<Self>` and `handles` to be saved, which is much smaller than the future returned by `Remote::get_redirected_final_url` * Refactor: Simplify `wait_on_cancellation_signal` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
647e340d38
commit
73a794dc13
2 changed files with 4 additions and 12 deletions
|
@ -41,16 +41,12 @@ fn ignore_signals() -> io::Result<()> {
|
|||
/// that also returns `Ok(())`.
|
||||
async fn wait_on_cancellation_signal() -> Result<(), io::Error> {
|
||||
#[cfg(unix)]
|
||||
async fn inner() -> Result<(), io::Error> {
|
||||
unix::wait_on_cancellation_signal_unix().await
|
||||
}
|
||||
unix::wait_on_cancellation_signal_unix().await?;
|
||||
|
||||
#[cfg(not(unix))]
|
||||
async fn inner() -> Result<(), io::Error> {
|
||||
signal::ctrl_c().await
|
||||
}
|
||||
signal::ctrl_c().await?;
|
||||
|
||||
inner().await
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue