嘗試做一個 envchain 的仿品 (6)

最近這幾天,下班後沒什麼動力,而且胃病又找上門,更是折磨人,還是沒有什麼明顯的進度。看了一下 dbus-rs 給的範例裡滿滿的 unwrap(),很好奇這方法是何作用,便搜尋了一下:

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.”

原來是一個錯誤處理用的便捷(且看來有點暴力?)方法。

CC BY-SA 4.0 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Leave a Reply

Your email address will not be published. Required fields are marked *