Skip to content

Commit b183738

Browse files
authored
Merge pull request #129 from Victor-Savu/patch-1
Remove unnecessary line in example
2 parents 68ba11a + 5b65485 commit b183738

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/2024h2/ergonomic-rc.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ Others adopt a slightly different pattern leveraging local variable shadowing:
4242
```rust
4343
let state = Arc::new(some_state);
4444

45-
let _state = state.clone();
4645
tokio::spawn({
4746
let state = state.clone();
4847
async move { /*code using `state`*/ }
49-
);
48+
});
5049
```
5150

5251
Whichever pattern users adopt, explicit clones of reference counted values leads to significant accidental complexity for many applications. As noted, cloning these values is both cheap at runtime and has zero semantic importance, since each clone is as good as the other.

0 commit comments

Comments
 (0)