Skip to content
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 strange behaviour for when the prefix has spaces #215

Merged
merged 2 commits into from
Nov 13, 2017

Conversation

thinkier
Copy link

The last time I was in this section of code, I splitted the string by whitespaces then took the second element, ignoring whether the prefix has whitespaces in it or not. I re-implemented the function to prevent strange behaviours for prefixes with whitespaces, and also added cases for non-space whitespaces.

@hsiW hsiW added the fix A solution to an existing bug. label Nov 12, 2017
for i in 0..slice.len() {
// 0x20 is ASCII for space
match slice[i] {
0x09 => {} // \t
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use | to group these up.
e. g
0x09 | 0x0a | 0x0d | 0x20 => {}

Copy link
Author

@thinkier thinkier Nov 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. (I'm not fluent with match cases hehe....)

@arqunis arqunis merged commit 10c56a9 into serenity-rs:v0.5.0 Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A solution to an existing bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants