These are chat archives for rust-lang/rust

Mar 2018
Sylwester Rąpała
Mar 15 2018 00:02
I know there is bytes::BytesMut that can store bytes in noncontinous memory. Mayby there is a implementation for string, or you can start looking there how to implement it.
Mar 15 2018 06:10
@Kane-Sendgrid you might want to look around for rope implementations in rust
Denis Lisov
Mar 15 2018 06:39
@Kane-Sendgrid It will double capacity, AFAIK.
Mar 15 2018 17:38
Hi there, i'm new to rust and trying to use tokio/hyper to make some http requests. I just posted my question in stack overflow, if anyone could help that would be great!
Sylwester Rąpała
Mar 15 2018 18:12
@estk add some code to that question.
And there is response in compiler error | ^^^^^^ expected struct `tokio_core::reactor::Handle`, found struct `tokio::reactor::Handle
expected tokio_core.. found tokio..
Mar 15 2018 19:14
Does anyone can recommend a rust library that can parse a .rs file, generate an AST that can be manipulated and let me transformed it back to a .rs file? I found syn and pest but it doesn't seem to fit my requirements or examples are not clear enough on the subject. Thanks
Jimmie Fulton
Mar 15 2018 22:20
Hi folks. New to systems level programming and rust. I’m interested in zero-copy serialization/deserialization. I’m not certain, but I think I may have identified a bug regarding serde deserialization of borrowed byte arrays. I’ve got deserialization of &str working fine, but deserializing a byte array slice doesn’t work.
BTW, I’ve also tried serializing with rmp_serde (MessgagePack), and I get the same error.
Danny Angelo Carminati Grein
Mar 15 2018 23:08

Hello, I'm having some trouble with failure::Error that I can't figure out:

#[derive(Fail, Debug)]
#[fail(display = "missing required field: {}", _0)]
pub struct MissingField(&'static str);

then trying to open a file:

fn test() -> Result<(), Error> {

    = note: expected type `MissingField`
               found type `failure::Error`

If I remove "Error" from the returning result it works, but in my current case I'm using an external dependency that has this kind of return and I'm returning my errors in a future for that API. So the error represented here is the same I get there.
Any hints on what I'm missing here?