Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example from the main page doesn't work with 0.3.0 #3

Open
aleksmelnikov opened this issue Aug 16, 2019 · 1 comment · May be fixed by #4
Open

Example from the main page doesn't work with 0.3.0 #3

aleksmelnikov opened this issue Aug 16, 2019 · 1 comment · May be fixed by #4

Comments

@aleksmelnikov
Copy link

let mut encoder = Encoder::new();
let headers = vec![
    (b":method".to_vec(), b"GET".to_vec()),
    (b":path".to_vec(), b"/".to_vec()),
];
// The headers are encoded by providing their index (with a bit flag
// indicating that the indexed representation is used).
assert_eq!(encoder.encode(&headers), vec![2 | 0x80, 4 | 0x80]);

Gives the error with 0.3.0 crate version:

    Updating crates.io index
   Compiling hpack v0.3.0
   Compiling test_hpack_1 v0.1.0 (/at/rust/workspace/test_hpack_1)
error[E0271]: type mismatch resolving `<&std::vec::Vec<(std::vec::Vec<u8>, std::vec::Vec<u8>)> as std::iter::IntoIterator>::Item == (&[u8], &[u8])`
  --> test_hpack_1/src/main.rs:13:20
   |
13 | assert_eq!(encoder.encode(&headers), vec![2 | 0x80, 4 | 0x80]);
   |                    ^^^^^^ expected reference, found tuple
   |
   = note: expected type `&(std::vec::Vec<u8>, std::vec::Vec<u8>)`
              found type `(&[u8], &[u8])`
@MoMannn
Copy link

MoMannn commented Jul 2, 2020

Same issue:

expected reference `&(std::vec::Vec<u8>, std::vec::Vec<u8>)`
             found tuple `(&[u8], &[u8])`

@MoMannn MoMannn linked a pull request Jul 2, 2020 that will close this issue
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 a pull request may close this issue.

2 participants