Skip to content

Conversation

@harmony7
Copy link
Member

This gives type inference problems

        req.get_header_all("upgrade")
            .collect()
            .contains(&&HeaderValue::from_static("websocket"))
    Checking fastly-compute-project v0.1.0 (/Users/komuro/Developer/fastly/compute-starter-kit-rust-fanout-forward)
error[E0282]: type annotations needed
  --> src/main.rs:17:14
   |
17 |             .collect()
   |              ^^^^^^^ cannot infer type of the type parameter `B` declared on the method `collect`
   |
help: consider specifying the generic argument
   |
17 |             .collect::<Vec<_>>()
   |                     ++++++++++

For more information about this error, try `rustc --explain E0282`.

So replacing with

        req.get_header_all("upgrade")
            .any(|value| value == &HeaderValue::from_static("websocket")) {

@harmony7 harmony7 requested a review from kailan January 16, 2025 03:40
@harmony7 harmony7 merged commit 92ec536 into main Jan 16, 2025
1 check failed
@harmony7 harmony7 deleted the kats/iterator-type branch January 16, 2025 03:42
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.

2 participants