最近這幾天,下班後沒什麼動力,而且胃病又找上門,更是折磨人,還是沒有什麼明顯的進度。看了一下 dbus-rs 給的範例裡滿滿的 unwrap(),很好奇這方法是何作用,便搜尋了一下:
- Error Handling
- Option & unwrap | Rust by Example
- Is unwrap really unsafe?:rust
- What does unwrap mean in rust?:rust
To “unwrap” something in Rust is to say, “Give me the result of the computation, and if there was an error, panic and stop the program.”
原來是一個錯誤處理用的便捷(且看來有點暴力?)方法。
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.