Skip to content

Conversation

@Fishrock123
Copy link
Member

This new lint popped up overnight, see
rust-lang/rust-clippy#6044

The problem is that we do indeed want this structure.

  • The outer Arc allows us to clone in .send() without cloning the array.
  • The Vec allows us to add middleware at runtime.
  • The inner Arc-s allow us to implement Clone without sharing the vector with the parent.
  • We don't use a Mutex around the Vec here because adding a middleware during execution should be an error.

This new lint popped up overnight, see
rust-lang/rust-clippy#6044

The problem is that we do indeed want this structure.
- The outer Arc allows us to clone in .send() without cloning the array.
- The Vec allows us to add middleware at runtime.
- The inner Arc-s allow us to implement Clone without sharing the vector with the parent.
- We don't use a Mutex around the Vec here because adding a middleware during execution should be an error.
Fishrock123 added a commit to Fishrock123/tide that referenced this pull request Sep 27, 2020
Fishrock123 added a commit to Fishrock123/rust-clippy that referenced this pull request Sep 27, 2020
This didn't display some types properly in the docs due the lack of code formatting.

Also, refs for the caveat:
rust-lang#6044 (comment)
http-rs/surf#242
bors added a commit to rust-lang/rust-clippy that referenced this pull request Sep 27, 2020
lints: clarify rc_buffer and add caveats

This didn't display some types properly in the docs due the lack of code formatting.

Also, refs for the caveat:
#6044 (comment)
http-rs/surf#242

Fwiw I can't get `cargo test` to run, even on nightly. I get:
```
error[E0463]: can't find crate for `rustc_ast`
```

*Please keep the line below*
changelog: none, nightly
@Fishrock123 Fishrock123 merged commit 295d1d7 into http-rs:main Sep 27, 2020
jbr pushed a commit to http-rs/tide that referenced this pull request Oct 3, 2020
yoshuawuyts pushed a commit to http-rs/tide that referenced this pull request Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant