These are chat archives for rust-lang/rust

16th
Dec 2016
Matanel Levi
@matanelevi
Dec 16 2016 10:05
Hi guys, what is the best rust IDE for windows nowadays?
Didn't find an IDE with good intelisence / auto completion
Pavel Meledin
@btbvoy
Dec 16 2016 10:12
@matanelevi try rust plugin for IntellijIDEA
Matanel Levi
@matanelevi
Dec 16 2016 10:17
@btbvoy @Albibek thank you :)
@btbvoy it seems that intellij doesn't support debugging :(
Aleksey Kladov
@matklad
Dec 16 2016 10:18
Yep, that's true atm :(
Pavel Meledin
@btbvoy
Dec 16 2016 10:20
that's true, but you have println option 😆 and hope @matklad will be given time to implement it or somebody else who familiar with this part might help to improve this plugin
so far I'm using println
Aleksey Kladov
@matklad
Dec 16 2016 10:21
Yeah, we plan to start implementing debugging soonish... Unfortunately I myself is a printf guy, so it wasn't a priority from the start.
Pavel Meledin
@btbvoy
Dec 16 2016 10:22
and I'm keeping in mind that when I'll really need to debug either the plugin I mentioned will have debugging or there Eclipse has some plugin for rust with debugging or GDB via terminal 😄
Sebastian Blei
@iamsebastian
Dec 16 2016 10:47
Vim, vim, vim, vim. Friday!
Aleksey Kladov
@matklad
Dec 16 2016 10:56
Yep, both IntelliJ and Emacs have decent vim modes ;)
Matheus Magalhães de Alcantara
@demhydraz
Dec 16 2016 14:53
IntelliJ nah, but I must say that evil is very awesome
Sebastian Blei
@iamsebastian
Dec 16 2016 15:43
Evil?
Matheus Magalhães de Alcantara
@demhydraz
Dec 16 2016 16:12
The Extensible Vi Layer for emacs
Matanel Levi
@matanelevi
Dec 16 2016 16:37
blob
@matklad ^
Pavel Meledin
@btbvoy
Dec 16 2016 18:31
@matanelevi just specify Java SDK you have and it will work
if you don't have it installed you probably have to install some of java sdk
JDK I mean
David McGillicuddy
@djmcgill
Dec 16 2016 18:34
Has anybody here used Pencil before? https://crates.io/crates/pencil
I'm struggling in particular because all request handlers have to have type fn(&mut Request) -> PencilResult. So how do I introduce state in my application? static mut makes all accessing of the data unsafe which is not ideal.
Matanel Levi
@matanelevi
Dec 16 2016 18:38
blob
@btbvoy
Of course I did it, but it doesn't change anything
Matanel Levi
@matanelevi
Dec 16 2016 20:10
Is it possible in rust to do this:
let a = 1;
let b = 2;
a, b = b, a;
Andrey Lesnikov
@ozkriff
Dec 16 2016 20:15
fn main() {
    let a = 1;
    let b = 2;
    let (b, a) = (a, b);
    println!("a={}, b={}", a, b);
}
or https://doc.rust-lang.org/std/mem/fn.swap.html
Matanel Levi
@matanelevi
Dec 16 2016 20:25
@ozkriff and what about (self.a self.b) = (self.b, self.b);
oops, I meant:
self.a, self.b = self.b, self.a;
the best option here is to use mem::swap?
Aleksey Kladov
@matklad
Dec 16 2016 20:28
I would say that swap is always the idiomatic way to swap thigs
Matanel Levi
@matanelevi
Dec 16 2016 22:56
Is there a way to create a macro that accepts a function implementation? (not just a name)
my_macro!( { my function implementation } )
Actually, I meant this:
my_macro! ( 
    fn my_func(arg: u32) -> u32 { 
        implementation...
    }
)