2020년 5월 20일 수요일

rust unwrap




When looking at Rust code examples, the syntax that seems the strangest (weirdest) is .unwrap(). To easily understand, you can think of it as the function call crashing (panicking) if it fails. For now, just know that and move on lol.

rust 코드 예제를 보면 가장 이상하게(wierd)하게 보이는 구문이 있는데, .unwrap() 이다. 

쉽게 이해하면 function call 이 실패하면 crash(panic) 된다고 생각하면 된다.

일단 그렇게 알고 넘어가도록 ㅋㅋ