fix: improve error handling and code robustness

- state_machine.rs: if-let replaces is_some()+take().unwrap()
- state_machine.rs: expect() replaces unwrap() with invariant docs
- wifi/mod.rs: send_result uses self.id() instead of hardcoded string
This commit is contained in:
2026-03-31 23:25:47 +08:00
parent b570362546
commit d040f51cb2
2 changed files with 4 additions and 4 deletions

View File

@@ -111,7 +111,7 @@ impl WifiPlugin {
.context("wifi plugin context is not initialized")?;
ctx.tx.send(Envelope {
from: "wifi".to_string(),
from: self.id().to_string(),
to: Destination::Broadcast,
message: Message::WifiResult(payload),
})?;