These are chat archives for rust-lang/rust

21st
Dec 2018
AllowFlame
@AllowFlame
Dec 21 2018 00:59
Is there any way to set some custom variable while building? I tried env::set_var in build.rs but the env::var couldn’t read the var.
S1nus
@S1nus
Dec 21 2018 05:24
how active is this groupchat?
Björn Lindström
@bkhl
Dec 21 2018 05:26
S1nus, less so than the chats at irc.mozilla.org
Denis Lisov
@tanriol
Dec 21 2018 07:48
@AllowFlame If you want the variable to be available at compile time, you should use rustc-env in your output and access it from the source with the env! macro.
AllowFlame
@AllowFlame
Dec 21 2018 08:33
@tanriol Thank you. And I have one more curiosity about it. Do I have to edit some files such as .cargo/config or Cargo.toml to do it?
Denis Lisov
@tanriol
Dec 21 2018 08:46
Nope, should just work.
AllowFlame
@AllowFlame
Dec 21 2018 12:25
Thank you. :)
whoooah
@whoooah
Dec 21 2018 18:38

Hello :) How can i create new struct based on existing?

https://gist.github.com/whoooah/6e29a0c7267886952efc3399bf9dbb05

fname: self.fname,
| ^^^^^^^^^^ cannot move out of borrowed content

Should i somehow copy fname?