[PR #614] [MERGED] unsolicited main.rs refactor #642

Closed
opened 2026-03-03 13:48:27 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/gopher64/gopher64/pull/614
Author: @AdamSteinberg1
Created: 11/8/2025
Status: Merged
Merged: 11/8/2025
Merged by: @loganmc10

Base: mainHead: main


📝 Commits (3)

📊 Changes

1 file changed (+60 additions, -82 deletions)

View changed files

📝 src/main.rs (+60 -82)

📄 Description

Hey! This project looked really cool and I was looking for a way to practice some Rust. So, I went ahead and refactored main.rs to be more idiomatic. If this isn't the style you're going for, no big deal. I just wanted some practice. :)

Overview of Changes

  • main() now returns a anyhow::Result. This lets us use ? for some better semantics.
  • Most unwraps and all panics have been removed in favor of returning an Err
  • if let and let else statements are used to improve readability and reduce nesting where possible. (Also, got rid of some unwraps where we knew the Option had a value.)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/gopher64/gopher64/pull/614 **Author:** [@AdamSteinberg1](https://github.com/AdamSteinberg1) **Created:** 11/8/2025 **Status:** ✅ Merged **Merged:** 11/8/2025 **Merged by:** [@loganmc10](https://github.com/loganmc10) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (3) - [`592ad79`](https://github.com/gopher64/gopher64/commit/592ad79c6a65cb03ac6283a7ea85379c54499cb1) main.rs refactor - [`f424fd7`](https://github.com/gopher64/gopher64/commit/f424fd7bf86bdf0e99d9c70205679ef8751a14fb) remove anyhow - [`13b0392`](https://github.com/gopher64/gopher64/commit/13b03925654fb4d8ff9d098440f4d316f8e3b433) forgive me clippy, for I have sinned ### 📊 Changes **1 file changed** (+60 additions, -82 deletions) <details> <summary>View changed files</summary> 📝 `src/main.rs` (+60 -82) </details> ### 📄 Description Hey! This project looked really cool and I was looking for a way to practice some Rust. So, I went ahead and refactored `main.rs` to be more idiomatic. If this isn't the style you're going for, no big deal. I just wanted some practice. :) #### Overview of Changes * `main()` now returns a `anyhow::Result`. This lets us use `?` for some better semantics. * Most `unwrap`s and all `panic`s have been removed in favor of returning an `Err` * `if let` and `let else` statements are used to improve readability and reduce nesting where possible. (Also, got rid of some `unwrap`s where we knew the `Option` had a value.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 13:48:27 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gopher64#642
No description provided.