Files
RedBear-OS/local
vasilito 40c5d8a701 redbear-btctl: convert StubBackend::from_env panic to Result propagation
The single production-code panic in the redbear-* codebase was in
StubBackend::from_env() (backend.rs:192). It panicked when the
REDBEAR_BTCTL_STUB_ADAPTERS env var contained an invalid Bluetooth adapter
name.

Previously:
  - from_env() returned Self (infallible)
  - build_backend() returned Box<dyn Backend>
  - main() returned anyhow::Result<()>

After:
  - from_env() renamed to try_from_env() -> Result<Self, String>
  - build_backend() returns anyhow::Result<Box<dyn Backend>>
  - main() call sites use '?' to propagate errors
  - Adapter name validation now returns Err instead of crashing the daemon

The panic was the ONLY production-code panic across all 5 redbear-*
programs that this phase was scoped for. The other 13 panics are in
test code (#[cfg(test)] modules), which is idiomatic Rust testing
practice and does not need modification.

cargo check --manifest-path source/Cargo.toml passes cleanly.
2026-07-28 23:36:33 +09:00
..