当前位置:网站首页>rust allow dead_ code
rust allow dead_ code
2022-07-24 02:36:00 【AdleyTales】
// need `allow` To eliminate the warning , Because only one variable is used
#[allow(dead_code)]
enum Color {
Red,
Blue,
Green,
RGB(u32, u32, u32),
HSV(u32, u32, u32),
HSL(u32, u32, u32)
}
fn main() {
let color = Color::RGB(122, 17, 40);
println!("what color is it ?");
match color {
Color::Red => println!("The color is Red!"),
Color::RGB(a, b, c) => println!("Red: {}, green: {}, blue: {}", a, b, c),
_ => println!("unknown color")
}
}
边栏推荐
- [diary of supplementary questions] [2022 Niuke summer school 1] i-chiitoitsu
- 餐饮连锁门店重塑增长背后的数字化转型
- 認識傳輸層協議—TCP/UDP
- [untitled]
- Resumption: a deck of cards (54), three people fighting the landlord, what is the probability that the big and small kings are in the same family
- 【知识图谱】实践篇——基于医疗知识图谱的问答系统实践(Part2):图谱数据准备与导入
- [C language] preprocessing details
- 【补题日记】[2022牛客暑期多校1]I-Chiitoitsu
- Leetcode 70 climbing stairs, 199 right view of binary tree, 232 realizing queue with stack, 143 rearranging linked list
- [knowledge atlas] practice -- Practice of question and answer system based on medical knowledge atlas (Part2): Atlas data preparation and import
猜你喜欢

Network protocol details: UDP

Redis data type concept

Audio processing based on time-frequency diagram matlab

Composition API (in setup) watch usage details

pbootcms模板调用标签序数从2开始或者自动数开始

Leetcode exercise -- two questions about the nearest common ancestor of binary trees

Detailed vector

POP3客户端代码的实现

程序员必备技能----断点调试(IDEA版)

云原生讲解【扩展篇】
随机推荐
508. 出现次数最多的子树元素和-哈希表法纯c实现
[untitled]
C from zero
[jailhouse article] virtualization over multiprocessor system on chip an enabling paradigm for
【补题日记】[2022牛客暑期多校1]C-Grab the Seat
数据湖(十五):Spark与Iceberg整合写操作
How to judge null for different types of fields, sets, lists / sets / maps, and objects
IBM: realize the quantum advantage of fault tolerance by 2030
wallys/WiFi6 MiniPCIe Module 2T2R2 × 2.4GHz 2x5GHz MT7915 MT7975
[untitled]
Share an API Gateway project based on ABP and yarp
Mysql database, grouping function
让生活充满幸福感
NetApp FAS系列一个CIFS bug引起的控制器重启案例分享
No coding is required, and the "asynchronous request reply" mode is automatically implemented
Go basic notes_ 5_ Array slice
输入cnpm -v出现cnpm : 无法加载文件 C:\Users\19457\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本。
Reconnaître le Protocole de couche de transport - TCP / UDP
MySQL---four JDBC
Rylstim Screen Recorder