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

Compilation error when trying to install #33

Closed
swcloudgenie opened this issue Jul 24, 2024 · 1 comment · Fixed by #34
Closed

Compilation error when trying to install #33

swcloudgenie opened this issue Jul 24, 2024 · 1 comment · Fixed by #34
Assignees
Labels
dependencies Upgrade dependencies

Comments

@swcloudgenie
Copy link

When running cargo install openapi-tui I get the following compilation error:

error[E0308]: mismatched types
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openapi-tui-0.9.3/src/panes/body_editor.rs:70:38
     |
70   |     self.input.set_cursor_line_style(Style::default());
     |                --------------------- ^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found a different `ratatui::style::Style`
     |                |
     |                arguments to this method are incorrect
     |
     = note: `ratatui::style::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style.rs:227:1
     |
227  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-textarea-0.4.0/src/textarea.rs:1770:12
     |
1770 |     pub fn set_cursor_line_style(&mut self, style: Style) {
     |            ^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openapi-tui-0.9.3/src/panes/body_editor.rs:71:38
     |
71   |     self.input.set_line_number_style(Style::default().dim());
     |                --------------------- ^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found a different `ratatui::style::Style`
     |                |
     |                arguments to this method are incorrect
     |
     = note: `ratatui::style::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style.rs:227:1
     |
227  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-textarea-0.4.0/src/textarea.rs:1793:12
     |
1793 |     pub fn set_line_number_style(&mut self, style: Style) {
     |            ^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openapi-tui-0.9.3/src/panes/body_editor.rs:161:35
     |
161  |       self.input.set_cursor_style(Style::default().add_modifier(Modifier::REVERSED));
     |                  ---------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found a different `ratatui::style::Style`
     |                  |
     |                  arguments to this method are incorrect
     |
     = note: `ratatui::style::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style.rs:227:1
     |
227  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-textarea-0.4.0/src/textarea.rs:1941:12
     |
1941 |     pub fn set_cursor_style(&mut self, style: Style) {
     |            ^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openapi-tui-0.9.3/src/panes/body_editor.rs:163:35
     |
163  |       self.input.set_cursor_style(Style::default());
     |                  ---------------- ^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found a different `ratatui::style::Style`
     |                  |
     |                  arguments to this method are incorrect
     |
     = note: `ratatui::style::Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/style.rs:227:1
     |
227  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.27.0/src/style.rs:228:1
     |
228  | pub struct Style {
     | ^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
    --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-textarea-0.4.0/src/textarea.rs:1941:12
     |
1941 |     pub fn set_cursor_style(&mut self, style: Style) {
     |            ^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `impl ratatui::widgets::Widget + '_: Widget` is not satisfied
   --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openapi-tui-0.9.3/src/panes/body_editor.rs:168:29
    |
168 |         frame.render_widget(self.input.widget(), inner);
    |               ------------- ^^^^^^^^^^^^^^^^^^^ the trait `Widget` is not implemented for `impl ratatui::widgets::Widget + '_`
    |               |
    |               required by a bound introduced by this call
    |
    = help: the following other types implement trait `Widget`:
              &W
              &str
              BarChart<'_>
              Canvas<'_, F>
              Chart<'_>
              Gauge<'_>
              LineGauge<'_>
              Sparkline<'_>
            and 10 others
note: required by a bound in `ratatui::Frame::<'_>::render_widget`
   --> /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.3/src/terminal/frame.rs:74:29
    |
74  |     pub fn render_widget<W: Widget>(&mut self, widget: W, area: Rect) {
    |                             ^^^^^^ required by this bound in `Frame::<'_>::render_widget`

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
The following warnings were emitted during compilation:

warning: openapi-tui@0.9.3: Could not find a git repository in '/Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openapi-tui-0.9.3' or in any of its parents
warning: openapi-tui@0.9.3: VERGEN_GIT_BRANCH set to default
warning: openapi-tui@0.9.3: VERGEN_GIT_COMMIT_AUTHOR_EMAIL set to default
warning: openapi-tui@0.9.3: VERGEN_GIT_COMMIT_AUTHOR_NAME set to default
warning: openapi-tui@0.9.3: VERGEN_GIT_COMMIT_COUNT set to default
warning: openapi-tui@0.9.3: VERGEN_GIT_COMMIT_DATE set to default
warning: openapi-tui@0.9.3: VERGEN_GIT_COMMIT_MESSAGE set to default
warning: openapi-tui@0.9.3: VERGEN_GIT_COMMIT_TIMESTAMP set to default
warning: openapi-tui@0.9.3: VERGEN_GIT_DESCRIBE set to default
warning: openapi-tui@0.9.3: VERGEN_GIT_SHA set to default
warning: openapi-tui@0.9.3: VERGEN_GIT_DIRTY set to default

error: could not compile `openapi-tui` (bin "openapi-tui") due to 5 previous errors
error: failed to compile `openapi-tui v0.9.3`, intermediate artifacts can be found at `/var/folders/z0/1z0tcc6d377grn13rmh1kvxc0000gn/T/cargo-installWVU76w`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Cargo Version: cargo 1.79.0 (ffa9cf99a 2024-06-03)
Rust Compiler Version: rustc 1.79.0 (129f3b996 2024-06-10)

@zaghaghi
Copy link
Owner

Hi @swcloudgenie 👋

It's a mismatch between ratatui version in openapi-tui and tui-textarea. I'll upgrade ratatui version to the latest version asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Upgrade dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants