Skip to content

Commit 352db3b

Browse files
更新文档, 添加对块内代码的不省略说明
1 parent fc5a659 commit 352db3b

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

README-CN.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ let vec = vector![
298298
println!("{:?}", vec_2); // work well
299299
// println!("{:?}", vec_3); // borrow of moved value
300300
```
301+
## 请注意:
302+
* [使用 let _ = 或 let () = 执行任意代码](#使用-let-_--或-let---执行任意代码)
303+
* [使用块在返回前执行代码](#使用块在返回前执行代码)
304+
305+
中编写的代码将不会享受简写规则, 他们是完完全全的rust代码
306+
301307

302308
# 键值对容器类型
303309
同时, 该库还支持键值对容器类型, HashMap, BTreeMap

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ let vec = vector![
152152
assert_eq!(vec, vec![1, 2, 3, 3, 3]);
153153
```
154154

155-
## use let _ = or let () = to execute arbitrary code
155+
## use let _ = or let () = to execute code
156156
This is a very powerful feature, please use it with caution
157157
```rust
158158
use better_comprehension::vector;
@@ -309,6 +309,13 @@ println!("{:?}", vec_2); // work well
309309
// println!("{:?}", vec_3); // borrow of moved value
310310
```
311311

312+
## Pay attention
313+
The code written in
314+
* [use let _ = or let () = to execute code](#use-let-_--or-let---to-execute-code)
315+
* [Execute code in block before returning](#execute-code-in-block-before-returning)
316+
317+
will not enjoy the ergonomic rules, they are complete rust code
318+
312319
# Key-value collection types
313320
Also, this library supports key-value collection types, HashMap, BTreeMap
314321
And supports three key-value separators "=>" ":" ","

src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ let vec = vector![
153153
assert_eq!(vec, vec![1, 2, 3, 3, 3]);
154154
```
155155
156-
## use let _ = or let () = to execute arbitrary code
156+
## use let _ = or let () = to execute code
157157
This is a very powerful feature, please use it with caution
158158
```rust
159159
use better_comprehension::vector;
@@ -310,6 +310,14 @@ println!("{:?}", vec_2); // work well
310310
// println!("{:?}", vec_3); // borrow of moved value
311311
```
312312
313+
## Pay attention
314+
The code written in
315+
* [use let _ = or let () = to execute code](#use-let-_--or-let---to-execute-code)
316+
* [Execute code in block before returning](#execute-code-in-block-before-returning)
317+
318+
will not enjoy the ergonomic rules, they are complete rust code
319+
320+
313321
# Key-value collection types
314322
Also, this library supports key-value collection types, HashMap, BTreeMap
315323
And supports three key-value separators "=>" ":" ","

0 commit comments

Comments
 (0)