mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-09 05:20:03 +00:00
Create new type LazyJobserverClient
and use it to replace `jobserver::Client`. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
a1d7a7c117
commit
3981400ebb
3 changed files with 33 additions and 19 deletions
|
@ -160,10 +160,7 @@ impl Termination for MainExit {
|
|||
|
||||
fn main() -> MainExit {
|
||||
// Create jobserver client
|
||||
let jobserver_client = match create_jobserver_client() {
|
||||
Ok(jobserver_client) => jobserver_client,
|
||||
Err(binstall_err) => return MainExit::Error(binstall_err),
|
||||
};
|
||||
let jobserver_client = LazyJobserverClient::new();
|
||||
|
||||
let start = Instant::now();
|
||||
|
||||
|
@ -184,7 +181,7 @@ fn main() -> MainExit {
|
|||
})
|
||||
}
|
||||
|
||||
async fn entry(jobserver_client: jobserver::Client) -> Result<()> {
|
||||
async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> {
|
||||
// Filter extraneous arg when invoked by cargo
|
||||
// `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"]
|
||||
// `cargo binstall --help` gives ["/home/ryan/.cargo/bin/cargo-binstall", "binstall", "--help"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue