These are chat archives for rust-lang/rust

8th
Sep 2018
Zakarum
@omni-viral
Sep 08 2018 08:48
Is it sorted by id?
If not then position is the right thing
trsh
@trsh
Sep 08 2018 13:45
Hi. I need advice about Rust scripting > https://github.com/ruse-lang/langs-in-rust. What would you suggest? The idea is that advanced clients can write tiny script, that are later fed with data from Rust and result it returned to Rust.
Like middlwares
Other seem really compilcated and alien
Zakarum
@omni-viral
Sep 08 2018 14:41
rlua
matthias-t
@matthias-t
Sep 08 2018 15:58
Hello! Is there a way to open a file for editing in $EDITOR from Rust? I've tried with std::process::Command but it doesn't affect the shell.
Zakarum
@omni-viral
Sep 08 2018 16:49
How exactly shell must be affected?
matthias-t
@matthias-t
Sep 08 2018 16:50
Well, if $EDITOR is vim, then vim should open in the shell
Zakarum
@omni-viral
Sep 08 2018 16:51
In the same shell rust program is attached to?
matthias-t
@matthias-t
Sep 08 2018 16:51
Actually, maybe the shell doesn't matter. But the terminal window has to be the same
Kelly Thomas Kline
@kellytk
Sep 08 2018 18:14
@omni-viral What do you mean by "sorted by id?" id a the struct element I need to find the index of
Zakarum
@omni-viral
Sep 08 2018 18:18
@kellytk If the vector is sorted by id then you can use binary_search
Otherwise use Iterator::position
Kelly Thomas Kline
@kellytk
Sep 08 2018 18:18
@omni-viral How do I determine what the Vec is sorted by?
Zakarum
@omni-viral
Sep 08 2018 19:04
You can just know
Or not
Nicolas Bigaouette
@nbigaouette
Sep 08 2018 19:27
I'm having trouble with a trait, bounds on this trait for a generic function and lifetimes... I'd really appreciate some help on this... Here's a link to the playground: https://play.rust-lang.org/?gist=c0b3b56b5fa564568acd45d057d76434&version=stable&mode=debug&edition=2015
Zakarum
@omni-viral
Sep 08 2018 20:13
@nbigaouette leave only one lifetime for BatchedLabelDataset
At line 75 rewrite bound to for<'u> DS: BatchedLabelDataset<'u>
Hope it'll help
Or make it like this
Nicolas Bigaouette
@nbigaouette
Sep 08 2018 20:23
wow thanks, never seen that for<>: ... bound... how is it called?
(by the way, thanks a lot!!!)
Wow it works!! Thank you so much!!!! :D
Zakarum
@omni-viral
Sep 08 2018 20:50
for<'a> reads as "for any lifetime 'a"
HRLB
Higher ranked lifetime bounds
It is part of HRTB (higher ranked trait bounds) which is not implemented yet
Glad to help
patientplatypus
@patientplatypus
Sep 08 2018 21:37
hi
im looking at this tutorial
and it doesnt appear to work
specifically the line
.then(bytes => WebAssembly.instantiate(bytes, {}))
gives the error
TypeError: first argument must be a WebAssembly.Module, ArrayBuffer or typed array object
Does anyone know why? This is super frustrating to have a broken tutorial.
patientplatypus
@patientplatypus
Sep 08 2018 22:37
i have a new stackoverflow question if anyone has any ideas: https://stackoverflow.com/questions/52239924/webassembly-instantiatestreaming-wrong-mime-type