respond to jorges reviw– use expect(unreachable) // reason

This commit is contained in:
Lotte Steenbrink 2020-06-22 22:55:27 +02:00
parent f502132139
commit 080e96d290

View file

@ -219,7 +219,7 @@ fn notmain() -> Result<i32, anyhow::Error> {
}
let channel = rtt_res
.unwrap() // using ? instead wouldn't show the user any helpful error message
.expect("unreachable") // this block is only executed when rtt was successfully attached before
.up_channels()
.take(0)
.ok_or_else(|| anyhow!("RTT up channel 0 not found"))?;