These are chat archives for rust-lang/rust

18th
Mar 2018
Zakarum
@omni-viral
Mar 18 2018 09:43
I try to match enum variant like this. match (&foo, &bar) { (&Foo::X(ref x), &Foo::Y { y: ref z } => { ... }}
Foohas two variants: X and Y
foo and bar are of type Foo
I get an error
It says that Foo::Y is ambigous associated type
What do I do wrong?
David Harvey-Macaulay
@alteous
Mar 18 2018 11:52
Hi, is there a simple way of using str::split_whitespace whilst keeping track of the current line number?
A combination of str::lines and str::split seems way too complex.
for (num, line) in text.lines() {
    for token in line.split_whitespace() {
        // this is too complex because some data follows on the next line
    }
}
The situation is that str::parse is failing somewhere in the program but I have no idea where!
Restioson
@Restioson
Mar 18 2018 14:39
@Manishearth hi! Sorry for the mention, but would you mind taking a look at the PRs into your ArrayInit crate? Namely: Manishearth/array-init#7 and Manishearth/array-init#6
They're quite old by now...
Denis Lisov
@tanriol
Mar 18 2018 17:04
@omni-viral Seems to work for me...
Zakarum
@omni-viral
Mar 18 2018 18:04
@tanriol My fault. I wrote variant name worng inside match :satisfied:
Dylan DPC
@Dylan-DPC
Mar 18 2018 18:41
:joy:
Isaac Woods
@IsaacWoods
Mar 18 2018 20:15
@bioball - very late to the party but are you looking for and_then