Skip to content

Commit d2bb4eb

Browse files
authored
# Example(연구가 필요함) - rust-lang/rust-clippy#12895 rs lazy_static! { static ref FOO: String = "foo".to_uppercase(); } static BAR: Lazy<String> = Lazy::new(|| "BAR".to_lowercase()); - Could be written as: rs static FOO: LazyLock<String> = LazyLock::new(|| "foo".to_uppercase()); static BAR: LazyLock<String> = LazyLock::new(|| "BAR".to_lowercase());
1 parent ae395ab commit d2bb4eb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
# Result
22

33
```bash
4+
cargo r --release
5+
```
6+
47

8+
# Example(연구가 필요함)
9+
- https://github.com/rust-lang/rust-clippy/issues/12895
10+
11+
```rs
12+
lazy_static! {
13+
static ref FOO: String = "foo".to_uppercase();
14+
}
15+
static BAR: Lazy<String> = Lazy::new(|| "BAR".to_lowercase());
516
```
617

18+
- Could be written as:
19+
20+
```rs
21+
static FOO: LazyLock<String> = LazyLock::new(|| "foo".to_uppercase());
22+
static BAR: LazyLock<String> = LazyLock::new(|| "BAR".to_lowercase());
23+
```

0 commit comments

Comments
 (0)