refactor: Clean up workspace dependencies, eliminate unwrap panics, and improve code safety#179
Merged
Ghoul4500 merged 22 commits intoJul 26, 2026
Conversation
scardracs
marked this pull request as ready for review
July 20, 2026 09:30
scardracs
force-pushed
the
code-cleanup-and-safety
branch
6 times, most recently
from
July 21, 2026 15:50
a1fc346 to
4c9c8b3
Compare
scardracs
force-pushed
the
code-cleanup-and-safety
branch
from
July 24, 2026 06:18
4c9c8b3 to
e75c949
Compare
Ghoul4500
requested changes
Jul 25, 2026
Ghoul4500
left a comment
Member
There was a problem hiding this comment.
Minor changes. Otherwise good job, thank you for your contribution
scardracs
force-pushed
the
code-cleanup-and-safety
branch
from
July 25, 2026 16:22
e1d16ba to
ab8ea9f
Compare
…rning logs in sysfs fan curve parsing
…, and remove unwrap calls
…d eliminate unwrap calls
…and eliminate unwrap calls
scardracs
force-pushed
the
code-cleanup-and-safety
branch
from
July 25, 2026 16:34
ab8ea9f to
7498baa
Compare
5 tasks
scardracs
marked this pull request as draft
July 26, 2026 09:25
scardracs
marked this pull request as ready for review
July 26, 2026 09:28
scardracs
marked this pull request as draft
July 26, 2026 09:39
scardracs
marked this pull request as ready for review
July 26, 2026 12:14
Ghoul4500
approved these changes
Jul 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Summary
This Pull Request combines workspace dependency cleanup with a comprehensive codebase refactoring aimed at code safety, panic elimination, leftover debug macro cleanup, and structural improvements across all
asusctlcrates and daemons.Main Objectives:
workspace.dependencies, replace the unmaintained externalsggit crate with a nativerog-scsiSCSI implementation, and pin crate versions cleanly..unwrap()Elimination: Systematically replace.unwrap()andpanic!calls with explicit error propagation (?), safe matching, and fallbacks inasusd,asusctl,rog-control-center,rog-aura,rog-platform,rog-profiles, andconfig-traits.dbg!macros from production code paths.config-traits.🚀 Key Changes Breakdown
📦 1. Workspace Dependencies & Build Infrastructure
sgwith a dedicated, memory-safe native implementation (rog-scsi/src/sg.rs).Cargo.tomlunder[workspace.dependencies].ronversion to^0.12.2.supergfxctldependencies from distribution packaging files and purged unused GitLab CI configurations.🛡️ 2. Safety & Error Handling (
unwrap/panic!Removal)asusd/ Daemon: Replaced unwrap calls and panics inAuraConfig(StdConfig),aura_manager,ctrl_platform, and daemon initialization with error handling, default fallbacks, and logging.asusctl/ CLI: Handled missing or uninitialized D-Bus services gracefully without CLI panics.rog-control-center/ GUI:.unwrap()calls across async D-Bus proxy calls (min_value,max_value,current_value), profile change streams, and Slint UI weak handle callbacks (show_toast).panic!with graceful stderr output and early exit.rog-aura&rog-profiles: Protected sysfs parsing against out-of-bounds access and string slicing panics (Colour::from_str), addedwarn!logging to allelseparsing branches, and usedunreachable!for non-keyboard device power byte calculations per review feedback.config-traits: Implemented atomic file writes via temporary files and automatic recursive parent directory creation.dbg!macro calls fromasusctl/src/main.rsandrog-control-center/src/ui/setup_fans.rs.⚡ 3. Safety & Unsafe Block Removal
unsafeblocks inrog-aura,rog-profiles, androg-platformto use safe standard library methods.unsafeblocks inrog-scsi/src/sg.rshave detailed// SAFETY:invariant documentation.🔬 Verification & Quality Assurance
All changes have been strictly verified locally against the workspace quality requirements:
cargo fmt --all -- --check(Passed - 0 errors)cargo clippy --all -- -D warnings(Passed - 0 warnings)cargo cranky(Passed - 0 warnings)cargo test --all(Passed - 58/58 test suites passing)📜 Commit History Included in PR
fix(asusd): replace panics with graceful error handling and fallbacksfix(rog-control-center): eliminate unwrap panics in D-Bus calls and Slint UI callbacksfix: remove leftover dbg! macros from production codechore: pin ron workspace dependency version to ^0.12.2style: sort workspace dependencies alphabetically in Cargo.tomlrefactor: centralize external crate dependencies into workspace.dependenciesrefactor: replace external sg git dependency with native rog-scsi implementationfix(asusctl): improve CLI robustness under missing or empty services and eliminate unwrap callsfix(asusd): replace unwrap panics with error handling in daemon and inotify watchersfix(rog-control-center): handle missing tray assets, D-Bus errors, and eliminate unwrap callsfix(config-traits): implement atomic file writes and recursive directory creationfix(rog-platform): improve CPU EPP optional handling, PCI slots check, and remove unwrap callsfix(rog-profiles): eliminate panics, out-of-bounds access, and add warning logs in sysfs fan curve parsingfix(rog-aura): improve LED config error handling and power state conversion safetyfix: prevent string slicing panics in Colour::from_strrefactor: remove unsafe blocks in rog-aura, rog-profiles, and rog-platformchore: remove supergfxctl dependency from packaging filesmeta: remove GitLab CI configuration and issue templates