Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build on Asahi Linux Arm64 #11

Closed
tmeijn opened this issue Jul 4, 2024 · 4 comments
Closed

Cannot build on Asahi Linux Arm64 #11

tmeijn opened this issue Jul 4, 2024 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@tmeijn
Copy link

tmeijn commented Jul 4, 2024

Hey, came across this project from https://terminaltrove.com

However I am not able to build the project when running cargo install stu. It gives me the following error:

   Compiling stu v0.5.0
error[E0277]: a value of type `Vec<ratatui::text::Line<'_>>` cannot be built from an iterator over elements of type `ratatui::text::line::Line<'_>`
  --> /home/tmeijn/.local/share/mise/installs/rust/1.78.0/registry/src/index.crates.io-6f17d22bba15001f/stu-0.5.0/src/widget/text_preview.rs:81:51
   |
81 |             Ok(s.into_text().unwrap().into_iter().collect())
   |                                                   ^^^^^^^ value of type `Vec<ratatui::text::Line<'_>>` cannot be built from `std::iter::Iterator<Item=ratatui::text::line::Line<'_>>`
   |
   = help: the trait `FromIterator<ratatui::text::line::Line<'_>>` is not implemented for `Vec<ratatui::text::Line<'_>>`
   = help: the trait `FromIterator<ratatui::text::Line<'_>>` is implemented for `Vec<ratatui::text::Line<'_>>`
   = help: for that trait implementation, expected `ratatui::text::Line<'_>`, found `ratatui::text::line::Line<'_>`
note: the method call chain might not have had the expected associated types
  --> /home/tmeijn/.local/share/mise/installs/rust/1.78.0/registry/src/index.crates.io-6f17d22bba15001f/stu-0.5.0/src/widget/text_preview.rs:74:18
   |
73 |               let s = LinesWithEndings::from(s)
   |                       ------------------------- this expression has type `LinesWithEndings<'_>`
74 |                   .map(|line| {
   |  __________________^
75 | |                     let ranges: Vec<(syntect::highlighting::Style, &str)> =
76 | |                         h.highlight_line(line, &SYNTAX_SET).unwrap();
77 | |                     as_24_bit_terminal_escaped(&ranges[..], false)
78 | |                 })
   | |__________________^ `Iterator::Item` is `String` here
...
81 |               Ok(s.into_text().unwrap().into_iter().collect())
   |                                         ----------- `Iterator::Item` is `Line<'_>` here
note: required by a bound in `collect`
  --> /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/iter/traits/iterator.rs:1999:5
help: consider removing this method call, as the receiver has type `ratatui::text::text::Text<'_>` and `ratatui::text::text::Text<'_>: FromIterator<ratatui::text::line::Line<'_>>` trivially holds
   |
81 -             Ok(s.into_text().unwrap().into_iter().collect())
81 +             Ok(s.into_text().unwrap().collect())
   |

For more information about this error, try `rustc --explain E0277`.
error: could not compile `stu` (bin "stu") due to 1 previous error
error: failed to compile `stu v0.5.0`, intermediate artifacts can be found at `/tmp/cargo-installJJEe4L`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
@lusingander
Copy link
Owner

lusingander commented Jul 4, 2024

Thank you for your report.

For now, could you please check if it can be installed by running cargo install --locked stu? It seems to be a library version issue...

@tmeijn
Copy link
Author

tmeijn commented Jul 4, 2024

That indeed worked @lusingander!

@lusingander
Copy link
Owner

lusingander commented Jul 4, 2024

Thank you for confirming 🙂 I've updated the README: faca2a1

@lusingander
Copy link
Owner

I think updating the documentation will solve the issue.

@lusingander lusingander added the documentation Improvements or additions to documentation label Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants