These are chat archives for rust-lang/rust

25th
Oct 2018
I want to match all thats between curly brackets
trsh
@trsh
Oct 25 2018 09:16
Current example gives one redundant capture, and ignores id2
Vitaly
@Virtuos86
Oct 25 2018 09:21
pub fn captures<'t>(&self, text: &'t str) -> Option<Captures<'t>>
Returns the capture groups corresponding to the leftmost-FIRST match in text.
trsh
@trsh
Oct 25 2018 09:32
ahh
Tnx @Virtuos86
trsh
@trsh
Oct 25 2018 09:46
@Virtuos86 im getting results with CB includes, https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=9efb94142100774f65001e046d98067b, is the regex wrong?
trsh
@trsh
Oct 25 2018 10:00
Git it, have to use other iterator
Vitaly
@Virtuos86
Oct 25 2018 10:40
Yes, you need captures_iter.
Alexey
@alleycat-at-git
Oct 25 2018 19:40
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
@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
Ok, thanks, did that serde-rs/json#502
D'Silva
@evnix
Oct 25 2018 20:54
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
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
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
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
@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.