These are chat archives for rust-lang/rust

1st
May 2019
Denis Lisov
@tanriol
May 01 00:05
Don't know about any option with windows support.
WindSoilder
@WindSoilder
May 01 00:05
Emm...thanks very much, and what about MacOS and Linux?
Denis Lisov
@tanriol
May 01 00:08
No idea what method MacOS uses. Many command-line utilities in Linux support environment variables like https_proxy and there's the env_proxy crate that can handle these.
Also you may be interested in seanmonstar/reqwest#403 where the reqwest HTTP client maintainers agreed that reqwest should work with system default proxies... however, there's no implementation for this behavior yet.
WindSoilder
@WindSoilder
May 01 01:13
Ah, okey. I will check out them. Thank you very much :)
Ichoran
@Ichoran
May 01 01:25
I'm having trouble with a simple nom parser that's supposed to read f64 out of a text file. Everything goes fine until I reach the end of the input at which point I get Err(Incomplete(Size(1))). If I try to use complete! on the last token, I instead get Err(Error(Code([54], Complete))) (where the code corresponds to 6, the last number in my example). It seems like there should be a really simple solution but I haven't been able to find it yet.
Ichoran
@Ichoran
May 01 01:30
The issue seems to be that double returns Incomplete at the end of the line instead of a successful answer as it would if it knew the next character was a space or some other non-number character. So it seems I either need to inject a spurious space or...what?
Ichoran
@Ichoran
May 01 01:42
I guess I have to use alt_complete!, grab the whole token speculatively, attempt to convert it from a string, and bail on the error?
Denis Lisov
@tanriol
May 01 09:32
@Ichoran The "intended" solution here is parsers based on CompleteStr instead of &str (CompleteByteSlice instead of &[u8])
Ichoran
@Ichoran
May 01 19:17
Ah, okay. I'll give that a try. Thanks! From reading the docs it seemed to me like it would just convert incomplete to errors (which is completely unhelpful), but I didn't actually try it.
(Also, I am not sure there is a double for CompleteStr input, but I haven't checked carefully enough.)
Ichoran
@Ichoran
May 01 19:23
Seems like it's not a solved problem: Geal/nom#795
Thanks for the pointer, though, @tanriol
Denis Lisov
@tanriol
May 01 19:23
This is going to change again in nom 5 series, afaik.
Ichoran
@Ichoran
May 01 19:28
I hope so!
Ichoran
@Ichoran
May 01 21:43
Yes, I really hope so. Granted this is the first time I've touched nom, but spending nearly three hours to handle end-of-input gracefully is kind of absurd.