diff options
author | bidit <devkotabidit@gmail.com> | 2017-04-13 08:15:11 +0545 |
---|---|---|
committer | bidit <devkotabidit@gmail.com> | 2017-04-13 08:15:11 +0545 |
commit | 08c0923b0d3274f5a812da94f467c29d34fe03c3 (patch) | |
tree | 252507ceaa8c8d0f32bdf9e07eaa44aed9664613 /src/regex_set.rs | |
parent | 3837dd936a713d014f0913f73fc298f3a44a8d2c (diff) |
Three Changes introduced:
1. Added new method `command_line_flags` to `Builder` to generate
list of command line arguments supplied.[file: src/lib.rs]
2. Added new method `get_set` and `get_items` method to `RegexSet`
to return immutable reference to it's fields.[file: src/regex_set.rs]
3. Added simple test case for `command_line_flags` method.[file: src/lib.rs]
Diffstat (limited to 'src/regex_set.rs')
-rw-r--r-- | src/regex_set.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/regex_set.rs b/src/regex_set.rs index 2eff740b..a93e7a13 100644 --- a/src/regex_set.rs +++ b/src/regex_set.rs @@ -35,6 +35,15 @@ impl RegexSet { self.items.push(format!("^{}$", string.as_ref())); self.set = None; } + + /// Returns slice of String from its field 'items' + pub fn get_items(&self) -> &[String] { + &self.items[..] + } + /// Returns reference of its field 'set' + pub fn get_set(&self) -> Option<&RxSet> { + self.set.as_ref() + } /// Construct a RegexSet from the set of entries we've accumulated. /// |