type
status
date
slug
summary
tags
category
icon
password

Range

Rather than using C style loop, in Rust, we use ..= to indicate a range:
Output:
Sequences are only allowed for numeric or character types because they can be consecutive.
 

Char

 
Use '' . "" is for the string
Accept Unicode, occupy 4 bytes.
 

Bool

 
Only 1 byte.
 

Unit type

 
Literally, it is ().
Yes, the unit type is (), and the value of this type is also, and only ().
It's similar to void in other languages.
Sometimes, you may come across code like Result<(), String>. This is an example of generic types in Rust. If you're familiar with C++ generic types, you can figure out that we pass 2 types into the Result, regardless of what the Result actually is.
Two Ways to Reverse a Singly Linked ListLagrange Interpolation Method
Loading...
Parker Chen
Parker Chen
Programming is Magic.
Announcement
将地址栏中的 'en' 修改为 'zh' 即可切换本页语言。
中文版为原始文章,英文版为翻译版本,如需参考原文请查看中文版。