Skip to content

Commit

Permalink
Merge pull request #129 from Victor-Savu/patch-1
Browse files Browse the repository at this point in the history
Remove unnecessary line in example
  • Loading branch information
nikomatsakis authored Aug 20, 2024
2 parents 68ba11a + 5b65485 commit b183738
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/2024h2/ergonomic-rc.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ Others adopt a slightly different pattern leveraging local variable shadowing:
```rust
let state = Arc::new(some_state);

let _state = state.clone();
tokio::spawn({
let state = state.clone();
async move { /*code using `state`*/ }
);
});
```

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.
Expand Down

0 comments on commit b183738

Please sign in to comment.