mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 15:57:09 +00:00
docs: Update code PR advice document
Allow using `expect()` for `Mutex.lock()` because it is almost unrecoverable if failed in the lock acquisition Fixes: #3285 Signed-off-by: Zack <zmlcc@linux.alibaba.com>
This commit is contained in:
parent
39cf2b27c1
commit
02608e13ab
@ -198,6 +198,7 @@ The table below lists the small number of cases where use of
|
|||||||
| `defer!()` | Similar to golang's `defer()` but doesn't allow the use of `?`. |
|
| `defer!()` | Similar to golang's `defer()` but doesn't allow the use of `?`. |
|
||||||
| `tokio::spawn(async move {})` | Cannot currently return a `Result` from an `async move` closure. |
|
| `tokio::spawn(async move {})` | Cannot currently return a `Result` from an `async move` closure. |
|
||||||
| If an explicit test is performed before the `unwrap()` / `expect()` | *"Just about acceptable"*, but not ideal `[*]` |
|
| If an explicit test is performed before the `unwrap()` / `expect()` | *"Just about acceptable"*, but not ideal `[*]` |
|
||||||
|
| `Mutex.lock()` | Almost unrecoverable if failed in the lock acquisition |
|
||||||
|
|
||||||
|
|
||||||
`[*]` - There can lead to bad *future* code: consider what would
|
`[*]` - There can lead to bad *future* code: consider what would
|
||||||
|
Loading…
Reference in New Issue
Block a user