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

Fix unused handle mouse function, pub mod appstate and some clippy warnings #971

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jeevithakannan2
Copy link
Contributor

@jeevithakannan2 jeevithakannan2 commented Nov 30, 2024

Type of Change

  • Refactoring

Description

  • Fix unnecessary usage of pub mod appstate and unused float handle mouse function.
  • Fix the below clippy warnings with new rust version.
warning: the following explicit lifetimes could be elided: 'a
   --> tui/src/floating_text.rs:174:6
    |
174 | impl<'a> FloatContent for FloatingText<'a> {
    |      ^^                                ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    = note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
    |
174 - impl<'a> FloatContent for FloatingText<'a> {
174 + impl FloatContent for FloatingText<'_> {
    |

warning: manually reimplementing `div_ceil`
  --> tui/src/hint.rs:39:16
   |
39 |     let rows = (shortcut_spans.len() + columns - 1) / columns;
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `shortcut_spans.len().div_ceil(columns)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil
   = note: `#[warn(clippy::manual_div_ceil)]` on by default

warning: `linutil_tui` (bin "linutil") generated 2 warnings (run `cargo clippy --fix --bin "linutil"` to apply 2 suggestions)

Testing

  • Tested on arch linux without any issues.

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no errors/warnings/merge conflicts.

Fix unnecessary usage of pub mod for appstate and resolve unused float handle mouse function
@jeevithakannan2 jeevithakannan2 changed the title Fix unused handle mouse function, pub mod appstate Fix unused handle mouse function, pub mod appstate and some clippy warnings Nov 30, 2024
@jeevithakannan2 jeevithakannan2 marked this pull request as draft November 30, 2024 12:57
Remove explicit lifetime for floatcontent impl. Use div_ceil instead of manually calculating the rows for hints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants