update readme

This commit is contained in:
sunface
2022-02-23 17:11:31 +08:00
parent dc6a4fb48a
commit d4a716d36c
176 changed files with 407 additions and 1 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -1 +1,28 @@
# Rust exercise
Greetings and welcome to `exercise.rs`here you can find bunch of easy to hard exercises to improve your Rust skillsthis will help you fill the gap of easy-to-learn and hard-to-use.
## Online Reading
This book is written in English and Chinese, you can pick up the language you are familiar with:
- English: [https://exercise.rs](https://exercise.rs)
- 简体中文: [https://zh.exercise.rs](https://zh.=[exercise.rs)
## Learning Rust
If you are a first-time Rust learner, here are some high quality learning resources :
- [The Book](https://doc.rust-lang.org/book/index.html) for English speakers
- [Rust语言圣经(The Course)](https://course.rs) for Chinese speakers, it covers nearly all the topics in Rust
## difference to rustlings
[Rustlings](https://github.com/rust-lang/rustlings) only contains small and easy exercises for junior rust devs. There is a big gap between learning Rust and using it in your projects.
Another limit for rustlings is that you have to download rustlings to local machine and compile it first before starting to learn.
## difference to rust by example
[Rust By Example](https://doc.rust-lang.org/stable/rust-by-example/) is an excellent online book for learning Rust`exercise.rs` has some small advantages in :
- more topics and exercisesspecially for the hard part of Ruste.g lifetime、smart pointers、threads 、async/.await etc
- difficulty from easy to hardit will minimize the gap between learning and using in projects
- up-to-date, e.g features which added in Rust 1.58 also have the corresponding exercises in `exercise.rs`
- Both `course.rs` and `exercise.rs` are designed according to the CS courses in collegeso quliaty is the most important factor

View File

View File

@ -10,10 +10,11 @@ editor = "ace"
[output.html.fold]
enable = true
level = 1
[output.html]
git-repository-url = "https://github.com/sunface/rust-exercise"
edit-url-template = "https://github.com/sunface/rust-exercise/edit/master/{path}"
edit-url-template = "https://github.com/sunface/rust-exercise/edit/master/en/{path}"
[rust]
edition = "2021"

View File

1
zh-CN/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
book

1
zh-CN/assets/CNAME Normal file
View File

@ -0,0 +1 @@
exercise.rs

20
zh-CN/book.toml Normal file
View File

@ -0,0 +1,20 @@
[book]
title = "Rust Exercise"
description = "A set of exercises and examples to pratice various aspects of Rust, also for the rust course (book) at https://course.rs"
authors = ["sunface, https://im.dev"]
language = "en"
[output.html.playpen]
editable = true
editor = "ace"
[output.html.fold]
enable = true
level = 1
[output.html]
git-repository-url = "https://github.com/sunface/rust-exercise"
edit-url-template = "https://github.com/sunface/rust-exercise/edit/master/zh-CN/{path}"
[rust]
edition = "2021"

21
zh-CN/deploy Executable file
View File

@ -0,0 +1,21 @@
## this script deploys the static website of course.rs to github pages
## build static website for book
mdbook build
## copy CNAME info to book dir
cp ./assets/CNAME ./book/
cp ./assets/*.html ./book/
cp ./assets/sitemap.xml ./book/
## init git repo
cd book
git init
git config user.name "sunface"
git config user.email "cto@188.com"
git add .
git commit -m 'deploy'
git branch -M gh-pages
git remote add origin https://github.com/sunface/rust-exercise
## push to github pages
git push -u -f origin gh-pages

78
zh-CN/src/SUMMARY.md Normal file
View File

@ -0,0 +1,78 @@
# Summary
- [关于 exercise.rs](why-exercise.md)
- [变量绑定与解构 todo](variables.md)
- [基本类型 todo](basic-types/intro.md)
- [数值类型](basic-types/numbers.md)
- [字符、布尔、单元类型](basic-types/char-bool-unit.md)
- [语句与表达式](basic-types/statements-expressions.md)
- [函数](basic-types/functions.md)
- [所有权和借用 todo](ownership/intro.md)
- [所有权](ownership/ownership.md)
- [引用和借用](ownership/borrowing.md)
- [复合类型 todo](compound-types/intro.md)
- [字符串与切片](compound-types/string-slice.md)
- [元组](compound-types/tuple.md)
- [结构体](compound-types/struct.md)
- [枚举](compound-types/enum.md)
- [数组](compound-types/array.md)
- [流程控制 todo](flow-control.md)
- [模式匹配 todo](pattern-match/intro.md)
- [match 和 if let](pattern-match/match-iflet.md)
- [解构 Option](pattern-match/option.md)
- [模式](pattern-match/patterns.md)
- [方法 Method todo](method.md)
- [泛型和特征 todo](generics-traits/intro.md)
- [泛型 Generics](generics-traits/generics.md)
- [特征 Traits](generics-traits/traits.md)
- [特征对象](generics-traits/trait-object.md)
- [进一步深入特征](generics-traits/advance-traits.md)
- [集合类型 todo](collections/intro.md)
- [动态数组 Vector](collections/vector.md)
- [KV 存储 HashMap](collections/hashmap.md)
- [类型转换 todo](type-conversion.md)
- [返回值和 panic! todo](result-panic/intro.md)
- [panic! 深入剖析](result-panic/panic.md)
- [返回值result 和 ?](result-panic/result.md)
- [包和模块 todo](crate-module/intro.md)
- [包 Crate](crate-module/crate.md)
- [模块 Module](crate-module/module.md)
- [使用use引入模块及受限可见性](crate-module/use-pub.md)
- [注释和文档 todo](comments-docs.md)
- [格式化输出 todo](formatted-output.md)
- [生命周期 todo](lifetime/intro.md)
- [生命周期基础](lifetime/basic.md)
- [&'static 和 T: 'static](lifetime/static.md)
- [深入生命周期](lifetime/advance.md)
- [函数式编程: 闭包、迭代器 todo](functional-programing/intro.md)
- [闭包 Closure](functional-programing/cloure.md)
- [迭代器 Iterator](functional-programing/iterator.md)
- [newtype 和 Sized todo](newtype-sized.md)
- [智能指针 todo](smart-pointers/intro.md)
- [Box](smart-pointers/box.md)
- [Deref](smart-pointers/deref.md)
- [Drop](smart-pointers/drop.md)
- [Rc and Arc](smart-pointers/rc-arc.md)
- [Cell and RefCell](smart-pointers/cell-refcell.md)
- [Weak 和循环引用todo](weak.md)
- [自引用 todo](self-referential.md)
- [多线程 todo](threads/intro.md)
- [多线程基础](threads/basic-using.md)
- [消息传递](threads/message-passing.md)
- [线程同步锁、Condvar和信号量](threads/sync.md)
- [线程同步Atomic](threads/atomic.md)
- [Send 和 Sync](threads/send-sync.md)
- [全局变量 todo](global-variables.md)
- [错误处理 todo](errors.md)
- [unsafe todo](unsafe.md)
- [macro 宏 todo](macro.md)
- [测试 todo](tests/intro.md)
- [编写测试及控制执行](tests/write-tests.md)
- [基准性能测试 Benchmark](tests/benchmark.md)
- [单元测试及集成测试](tests/unit-integration.md)
- [断言 Assertions](tests/assertions.md)
- [Async/Await 异步编程 todo](async/intro.md)
- [async 和 await!](async/async-await.md)
- [Future](async/future.md)
- [Pin 和 Unpin](async/pin-unpin.md)
- [Stream 流处理](async/stream.md)

View File

@ -0,0 +1 @@
# async and await!

View File

@ -0,0 +1 @@
# Future

1
zh-CN/src/async/intro.md Normal file
View File

@ -0,0 +1 @@
# Async/Await

View File

@ -0,0 +1 @@
# Pin and Unpin

View File

@ -0,0 +1 @@
# Stream

View File

@ -0,0 +1 @@
# Char, Bool and Unit

Some files were not shown because too many files have changed in this diff Show More