Search code examples
rustrust-cargo

Why can I not install cargo-generate?


I am trying to run a rust template and I get the error:

Error: Required cargo-generate version not met. Required: >=0.16.0, <0.18.0 was: 0.18.1

So I tried to install version 0.17.6 with the following command:

cargo install --version 0.17.6 cargo-generate

But I get the repeated error:

error[E0277]: the trait bound `BStr: AsRef<[_; 0]>` is not satisfied  
--> C:\Users\Comba\.cargo\registry\src\github.com-1ecc6299db9ec823\git-ref-0.23.1\src\store\packed\find.rs:95:35
    |
 95 |                 .map(|(_rest, r)| r.name.as_bstr().as_ref())   
    |                                   ^^^^^^^^^^^^^^^^ ------ required by a bound introduced by this call
    |
    |
    |                                   the trait `AsRef<[_; 0]>` is not implemented for `BStr`
    |    = help: the following other types implement trait `AsRef<T>`:
             <BStr as AsRef<BStr>>
             <BStr as AsRef<[u8]>>

Is there something else I should do here?


Solution

  • This is an issue with the crate cargo-generate that use git-config and git-ref. An issue has been submitted: https://github.com/cargo-generate/cargo-generate/issues/879

    The new version of cargo-generate v0.18.0 should fix the issue.