- const 必须指明变量类型
- 函数返回值类型通过 -> 指明
- if 必须在 {..} 中
- 数组元素必须是同类型的,let a: [u32; 100] = [0; 100];
- &str 和 String 类型的区别
- 模块同时导入多个 use std::time::{SystemTime, UNIX_EPOCH};
- HashMap 类型:entry(key).or_insert(default_value)
- Option/Result 解析出 Some/Ok 中的值用 unwrap()
- if let Some(v) = .. / While let Some(v) = ..
- Result 类型后添加 ?,会在 Err 类型自动返回
- main 函数中添加返回类型 Result<(), Box>,可以在其中使用 ?
- impl Wrapper 声明 Wrapper 结构体中定义的是泛型而不是具体类型
- 声明实现了某种 trait 的的类型可以用 impl Trait1 + Trait2 或者 Where ..
- ??iter() 和 into_iter() 的区别
- ??iter().map(..).collect() 会根据函数的返回值类型返回
- (1..=num).fold(1, |acc, elem| acc * elem)
- 智能指针,包括 Cow
- #[macro_export]
- clippy std::f32::consts::PI std::mem::swap
- from 和 into trait
- from_str 和 parse trait
- try_from 和 try_into trait
- as_ref 和 as_mut trait
rustlings's Introduction
rustlings's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.