mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-19 02:57:33 +00:00
[#1807] Add entry in docs/user/features
This commit is contained in:
parent
e17243d698
commit
fe8ec1c045
@ -166,6 +166,20 @@ impl Foo for S {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws)
|
||||||
|
|
||||||
|
```rust
|
||||||
|
// before:
|
||||||
|
fn example(x: bool) -> bool {
|
||||||
|
!x || !x
|
||||||
|
}
|
||||||
|
|
||||||
|
// after:
|
||||||
|
fn example(x: bool) -> bool {
|
||||||
|
!(x && !x)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
- Import path
|
- Import path
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|
Loading…
Reference in New Issue
Block a user