These are chat archives for rust-lang/rust

11th
Apr 2018
Russell Cohen
@rcoh
Apr 11 2018 00:04
Next question. Is it possible given a lifetime parameter <'a> to create an object and then borrow it with that lifetime?
I assume not since it won't life long enough
Andy Grove
@andygrove
Apr 11 2018 02:48
What is the best tool for profiling Rust code? I have googled this and the results are a bit inconclusive
Andy Grove
@andygrove
Apr 11 2018 03:07
hmm it looks like valgrind might work well enough actually
Russell Cohen
@rcoh
Apr 11 2018 07:01
I used oprofile wirh sime success
Rafael Villar Burke (Pachi)
@pachi
Apr 11 2018 09:14
Do you know any crate that implements autoderive for FromStr and the as_str method for an enum made of plain keys (so they would be converted from/to plain strings using the enum name)? or anything to implement an enum from a string array with those traits?
Michal 'vorner' Vaner
@vorner
Apr 11 2018 09:16
I've met several, but I don't remember the names. Try searching for something like enum and derive on crates.io, it'll definitely give some results.
Rafael Villar Burke (Pachi)
@pachi
Apr 11 2018 09:21
great, was just finding enum_derive on google, but crates.io search worked fine for this. Scum looks like what I'm looking for. Thanks @vorner
Ingvar Stepanyan
@RReverser
Apr 11 2018 11:45

What is the best tool for profiling Rust code? I have googled this and the results are a bit inconclusive

In theory any tool designed for native code should work well.

But tbh I profiled it only on Windows so far, and there it worked with Visual Studio's built-in profiler out of the box.
Dylan DPC
@Dylan-DPC
Apr 11 2018 14:19
what's the best way to share a "bin" with someone who doesn't have rust?
Michal 'vorner' Vaner
@vorner
Apr 11 2018 14:23
cargo build --release and copy it out from target/release
it should just run
Dylan DPC
@Dylan-DPC
Apr 11 2018 14:24
cool. am doing that