ynqa / promkit

A toolkit for building interactive prompt in Rust
https://crates.io/crates/promkit
MIT License
267 stars 7 forks source link

0.4.7 is backwards-incompatible #34

Closed darkwater closed 3 weeks ago

darkwater commented 3 weeks ago

I tried to cargo install jnv, but it failed with this error:

error[E0053]: method `finalize` has an incompatible type for trait
   --> /home/dark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jnv-0.4.1/src/jnv.rs:254:17
    |
254 |     fn finalize(&self) -> anyhow::Result<Self::Return> {
    |                 ^^^^^ types differ in mutability
    |
    = note: expected signature `fn(&mut Jnv) -> Result<_, _>`
               found signature `fn(&Jnv) -> Result<_, _>`
help: change the self-receiver type to match the trait
    |
254 |     fn finalize(&mut self) -> anyhow::Result<Self::Return> {
    |                 ~~~~~~~~~

For more information about this error, try `rustc --explain E0053`.
error: could not compile `jnv` (bin "jnv") due to 1 previous error

Digging into the code, this seems to be because promkit changed the API in 000ea72e: change finalize to mut self

This is a backwards-incompatible change, so I believe 0.4.7 should be yanked and published as 0.5.0 instead.

ynqa commented 3 weeks ago

@darkwater Thank you for the report, I understand that. The approach seems fine as well.

ynqa commented 3 weeks ago

Yanked v0.4.7 and released v0.5.0.