These are chat archives for rust-lang/rust

3rd
Jun 2018
Joseph Murphy
@JMurph2015
Jun 03 2018 04:42
Anyone interested in a community supported (hopefully cross-platform) Dropbox client? Me and a couple friends are thinking of taking the plunge and reinventing the wheel here. First killer feature would be support for .dropboxignore files
Oh yeah and also writing a codegen crate for Dropbox's Stone spec format (to generate a Rust SDK)
Fredrik Portström
@portstrom
Jun 03 2018 07:50
@ozgurakkurt The code you posted works without a problem. I think you may have omitted the code that causes that problem. http://play.rust-lang.org/?gist=0c754ccaf0627ea7dffbb2b577fa39bc
@ozgurakkurt I would suggest using the convenience function req.path() rather than req.uri().path().
tandrysyawaludin
@tandrysyawaludin
Jun 03 2018 08:30
how to count data in table?
Talden
@Talden
Jun 03 2018 08:50
Table? As in a database table? How are you accessing the database? Via an ORM (Diesel perhaps? https://gitter.im/diesel-rs/diesel || http://docs.diesel.rs/diesel/dsl/fn.count.html)
tandrysyawaludin
@tandrysyawaludin
Jun 03 2018 09:44
@tandrysyawaludin
i tried to use count_star(), but i got an error
partners::table.select(count_star()).first(connection);
|                                      ^^^^^ cannot infer type for `U`
ozgurakkurt
@ozgurakkurt
Jun 03 2018 18:14
@rnleach @portstrom I was moving the request object so it was causing a problem. I solved it by using the req.into_parts() method
Sylwester Rąpała
@xoac
Jun 03 2018 19:12

I have a struct like this:

pub struct MyStruct {
    hash: String,
}

And I would like to derefer it to string:

impl ops::Deref for MyStruct {
    type Target = str;

    fn deref(&self) -> &Self::Target {
        &self.hash
    }
}

Is this make any sense? I just wanna sure in MyStruct string is allways proper and if required send it just as a string to a function

Talden
@Talden
Jun 03 2018 23:37
Is there an example anywhere of a rocket-rs app accepting (upgrading) a websocket request?