These are chat archives for rust-lang/rust

25th
Oct 2018
I want to match all thats between curly brackets
Current example gives one redundant capture, and ignores id2
Vitaly
@Virtuos86
Oct 25 2018 09:21 UTC
pub fn captures<'t>(&self, text: &'t str) -> Option<Captures<'t>>
Returns the capture groups corresponding to the leftmost-FIRST match in text.
ahh
Tnx @Virtuos86
Git it, have to use other iterator
Vitaly
@Virtuos86
Oct 25 2018 10:40 UTC
Yes, you need captures_iter.
Alexey
@alleycat-at-git
Oct 25 2018 19:40 UTC
Hi! Does anyone know how to enable u128 on serde_json?
From build.rs in serde it looks like it should be enabled with rust>=1.26
However, it doesn't work
Zakarum
@omni-viral
Oct 25 2018 20:14 UTC
@alleycat-at-git No
Not all serializers in serde_json implement serialize_{iu}128
Those are in src/value/ser.rs
Not in public API
But to_value uses one
File bug for serde_json crate
Alexey
@alleycat-at-git
Oct 25 2018 20:38 UTC
Ok, thanks, did that serde-rs/json#502
D'Silva
@evnix
Oct 25 2018 20:54 UTC
i have 3 file a.rs b.rs and main.rs in the same directory.
How do i include a.rs code in b.rs?
I was able to include b.rs in main.rs using "mod b;" but can't figure out how to include a.rs code in b.rs
Lyle Mantooth
@IslandUsurper
Oct 25 2018 21:03 UTC
You can use mod a; in main.rs, and then use a; in b.rs.
The contents of a.rs may need to be pub for b.rs to see them, though.
D'Silva
@evnix
Oct 25 2018 21:06 UTC
Thanks, though that's strange, It feels like I have to change main.rs for everything.
Again for using external crates that need macro_use, I have to go back and change my main.rs file
Jason Ozias
@CraZySacX
Oct 25 2018 22:15 UTC
In the 2018 edition, the module system is a bit cleaner. You may want to check that out as well.
Lyle Mantooth
@IslandUsurper
Oct 25 2018 23:45 UTC
@evnix , 1.30 landed, and lets you use foo::macro; instead of #[macro_use]
Also, putting mod a; mod b; in main.rs is a consequence of putting all your files on the same level. You could mkdir b; mv b.rs b/mod.rs; mv a.rs b/ and have mod a; in b/mod.rs instead. You'd still have to be explicit with your use statements, though the paths would change then.