kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.41k stars 151 forks source link

error[E0308]: mismatched types #321

Closed colin4k closed 1 year ago

colin4k commented 1 year ago
` --> src/ui/widgets/tui_file_preview.rs:44:46 44 buf.set_spans(area.x, y, line, area.width); --------- ^^^^ expected &Spans<'_>, found &Line<'_>
arguments to this method are incorrect
= note: expected reference `&Spans<'_>`
           found reference `&ratatui::text::line::Line<'_>`

note: method defined here --> /home/colin/.cargo/registry/src/github.com-1ecc6299db9ec823/ratatui-0.20.1/src/buffer.rs:309:12 | 309 | pub fn setspans(&mut self, x: u16, y: u16, spans: &Spans<'>, width: u16) -> (u16, u16) { | ^^^^^^^^^

For more information about this error, try rustc --explain E0308.`

alexzhang1030 commented 1 year ago

Same

sxyazi commented 1 year ago

Same issue, but I figure out that using cargo build instead of cargo install works:

cargo build --release
cp target/release/joshuto /usr/local/bin
lthoerner commented 1 year ago

As of the latest release (0.21.0 I believe), Spans has been deprecated and renamed to Line to better reflect its usage as a type.

alexzhang1030 commented 1 year ago

Solved by #319

kamiyaa commented 1 year ago

@colin4k @sxyazi Can you confirm this has been resolved in the latest git version?

kamiyaa commented 1 year ago

Closing for now, feel free to re-open if issue persists