This looks like a good demo! But it won't build in cargo 1.57.0.
--> /Users/justin.collum/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-1.4.5/src/chars.rs:38:27
|
38 | Chars(Bytes::from(src))
| ^^^
|
note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
--> /Users/justin.collum/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-1.4.5/src/chars.rs:36:6
|
36 | impl<'a> From<&'a str> for Chars {
| ^^
note: ...so that the expression is assignable
--> /Users/justin.collum/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-1.4.5/src/chars.rs:38:27
|
38 | Chars(Bytes::from(src))
| ^^^
= note: expected `&str`
found `&'a str`
= note: but, the lifetime must be valid for the static lifetime...
note: ...so that the types are compatible
--> /Users/justin.collum/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-1.4.5/src/chars.rs:38:15
|
38 | Chars(Bytes::from(src))
| ^^^^^^^^^^^
= note: expected `From<&str>`
found `From<&'static str>`
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> /Users/justin.collum/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-1.4.5/src/buf_read_iter.rs:230:27
|
230 | let r = bytes.slice(self.pos_within_buf, self.pos_within_buf + len);
| ^^^^^ ------------------- ------------------------- supplied 2 arguments
| |
| expected 1 argument
|
note: associated function defined here
--> /Users/justin.collum/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.6.0/src/bytes.rs:228:12
|
228 | pub fn slice(&self, range: impl RangeBounds<usize>) -> Bytes {
| ^^^^^
Compiling crossbeam-deque v0.7.4
error[E0308]: mismatched types
--> /Users/justin.collum/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-1.4.5/src/buf_read_iter.rs:238:37
|
238 | self.read_exact(buf)?;
| ^^^ expected slice `[u8]`, found struct `UninitSlice`
|
= note: expected mutable reference `&mut [u8]`
found mutable reference `&mut UninitSlice`
Some errors have detailed explanations: E0061, E0308, E0495.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `protobuf` due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
I'm gonna try with a version of Rust that was released closer to when this was created.