-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed string-delimiters, added Regex- and Itertools-crates, ... #134
Conversation
…elimeter-typo to Delimiter across the library
src/lib.rs
Outdated
@@ -128,6 +128,9 @@ extern crate tokio_core; | |||
extern crate typemap; | |||
#[cfg(feature = "gateway")] | |||
extern crate websocket; | |||
#[cfg(feature = "framework")] | |||
extern crate regex; | |||
extern crate itertools; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feature-flag this as well
src/framework/mod.rs
Outdated
|
||
let regex = Regex::new(®ular_expression).unwrap(); | ||
|
||
let mut result: Vec<String> = vec![]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the for loop can be changed to
regex.split(content)
.filter_map(|p| if !p.is_empty() { Some(p.to_string()) } else { None })
.collect::<Vec<_>>()
src/framework/mod.rs
Outdated
.map(|arg| arg.to_owned()) | ||
.collect::<Vec<String>>() | ||
let delimiters = &self.configuration.delimiters; | ||
let regular_expression = delimiters.iter(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd look better (or less awkward) if you put this dot on the same line as map
.
... changed Delimeter-typo to Delimiter across the library