Skip to content

fix clippy, collapse ifs #196

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

Merged
merged 1 commit into from
Aug 8, 2025
Merged

fix clippy, collapse ifs #196

merged 1 commit into from
Aug 8, 2025

Conversation

achristmascarl
Copy link
Owner

@achristmascarl achristmascarl commented Aug 8, 2025

Important

Refactor code by collapsing nested if statements using let-else construct across multiple files to improve readability and maintainability.

  • Refactoring:
    • Collapse nested if statements using let-else construct in app.rs, editor.rs, favorites.rs, tui.rs, and utils.rs.
    • Improves code readability and maintainability without changing functionality.
  • Specific Changes:
    • In app.rs, refactor mouse event handling logic in draw_layout().
    • In editor.rs, refactor transition_vim_state() to use let-else for command transmission.
    • In favorites.rs, refactor search handling logic in handle_key_events().
    • In tui.rs, refactor tick_rate(), frame_rate(), and mouse() methods.
    • In utils.rs, refactor panic handler initialization in initialize_panic_handler().

This description was created by Ellipsis for 16c7cff. You can customize this summary. It will automatically update as commits are pushed.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 16c7cff in 4 minutes and 6 seconds. Click for details.
  • Reviewed 182 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/app.rs:524
  • Draft comment:
    Good refactoring: nested mouse event ifs collapsed using let-chain for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. src/components/editor.rs:59
  • Draft comment:
    Nicely collapsed nested ifs in transition_vim_state with let-chain.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. src/components/favorites.rs:207
  • Draft comment:
    Simplified search-empty check using if-let chain for conciseness.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. src/tui.rs:71
  • Draft comment:
    Improved tick_rate, frame_rate, and mouse setter readability using if-let.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
5. src/utils.rs:43
  • Draft comment:
    Refactored panic handler exit logic using if-let chain for brevity.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
6. src/app.rs:559
  • Draft comment:
    Typographical issue: It appears that "last_focused_tab" is intended to be invoked as a function (as seen on line 539). Consider changing self.state.focus = self.last_focused_tab; to self.state.focus = self.last_focused_tab(); to maintain consistency.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_wYjkFkF87FUgbHkk

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@achristmascarl achristmascarl merged commit 8dbd909 into main Aug 8, 2025
10 checks passed
@achristmascarl achristmascarl deleted the chore/fix-clippy branch August 8, 2025 17:23
Copy link

Included in release v0.3.5

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Aug 14, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [achristmascarl/rainfrog](https://github.com/achristmascarl/rainfrog) | patch | `v0.3.4` -> `v0.3.5` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>achristmascarl/rainfrog (achristmascarl/rainfrog)</summary>

### [`v0.3.5`](https://github.com/achristmascarl/rainfrog/releases/tag/v0.3.5)

[Compare Source](achristmascarl/rainfrog@v0.3.4...v0.3.5)

<!-- Release notes generated using configuration in .github/release.yml at v0.3.5 -->

#### What's Changed

- fix clippy, collapse ifs by [@&#8203;achristmascarl](https://github.com/achristmascarl) in achristmascarl/rainfrog#196
- Bump slab from 0.4.10 to 0.4.11 in the cargo group across 1 directory by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in achristmascarl/rainfrog#197
- fix: panic on none unwrap by [@&#8203;dshemin](https://github.com/dshemin) in achristmascarl/rainfrog#199

#### New Contributors

- [@&#8203;dshemin](https://github.com/dshemin) made their first contribution in achristmascarl/rainfrog#199

**Full Changelog**: achristmascarl/rainfrog@v0.3.4...v0.3.5

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS42Ni4yIiwidXBkYXRlZEluVmVyIjoiNDEuNjYuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
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.

1 participant