Rust match keyword

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2021 Apr 23 3:6
Editor
Edited
Edited
2024 Apr 23 3:57

강력한 흐름 제어 연산자

value 가지는 int enum 은 안되고 할당안된 값의 enum만 가능
 
 
 

if let match

Result<(), Error> 처럼 반환값이 없을 때 (unwrap할 필요 없으니)
Early-breaking from Rust's match
I want to switch through many possible cases for x and there's one case (here x == 0) where I want to check the result of some additional code to determine what to do next. One possibility is to re...
Early-breaking from Rust's match
The Rust Programming Language
Rust has an extremely powerful control flow construct called match that allows you to compare a value against a series of patterns and then execute code based on which pattern matches. Patterns can be made up of literal values, variable names, wildcards, and many other things; Chapter 18 covers all the different kinds of patterns and what they do.
The Rust Programming Language
러스트는 match라고 불리는 극도로 강력한 흐름 제어 연산자를 가지고 있는데 이는 우리에게 일련의 패턴에 대해 어떤 값을 비교한 뒤 어떤 패턴에 매치되었는지를 바탕으로 코드를 수행하도록 해줍니다. 패턴은 리터럴 값, 변수명, 와일드카드, 그리고 많은 다른 것들로 구성될 수 있습니다; 18장에서 다른 모든 종류의 패턴들과 이것들로 할 수 있는 것에 대해 다룰 것입니다.
 
 

Recommendations