- Rust Programming By Example
- Guillaume Gomez Antoni Boucher
- 75字
- 2021-07-02 19:12:59
Irrefutable patterns
Another form of pattern matching is irrefutable patterns. A pattern is irrefutable when there's only one way to match it and it always succeeds. For instance, another way to get the elements of a tuple is with an irrefutable pattern:
let tuple = (24, 42); let (a, b) = tuple; println!("{}, {}", a, b);
In the second line, we assign the first element of the tuple to a and the second to b.
推薦閱讀
- 情報學(xué)與信息管理的主戰(zhàn)場:北京大學(xué)情報學(xué)與信息管理論壇文集
- 科學(xué)普及組織活動讀本
- 中國人民大學(xué)復(fù)印報刊資料轉(zhuǎn)載指數(shù)排名研究報告2016
- 文件、信息商業(yè)化服務(wù)機構(gòu)建設(shè)研究
- 民國文獻辨?zhèn)螌W(xué)研究
- Learning Robotics using Python
- Hands-On Concurrency with Rust
- 河南省博物院鎮(zhèn)館之寶
- Mobile Artificial Intelligence Projects
- 中國人民大學(xué)復(fù)印報刊資料轉(zhuǎn)載指數(shù)排名研究報告2018(中國人民大學(xué)研究報告系列)
- 茶與咖啡:張信剛文化與經(jīng)濟講座
- 中國圖書館轉(zhuǎn)型風(fēng)險研究
- 當(dāng)代博物館的新角色與新視野
- 檔案與少數(shù)民族記憶
- 中國人民大學(xué)復(fù)印報刊資料轉(zhuǎn)載指數(shù)排名研究報告2017