-
Notifications
You must be signed in to change notification settings - Fork 523
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
Implement pangram #132
Implement pangram #132
Conversation
Implements the Pangram problem and follows the current canonical test suite. I'm putting the problem after scrabble score. I'm guessing that Most implementations will use iter -> filter -> collect (though students constantly surprise me with their great ideas). The track places these iterator -> Higher Order Function problems around scrabble score & hamming.
b50a468
to
adc92c5
Compare
Ok @exercism/rust this should be ready for your review. |
|
||
pub fn is_pangram(sentence: &str) -> bool { | ||
sentence.to_lowercase() | ||
.chars() |
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.
The .graphemes
iterator might be a better choice here:
http://www.steveklabnik.com/rust-issue-17340/#indexing-strings
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.
Weird. The doc site has nothing for that function.
http://doc.rust-lang.org/std/?search=grapheme
And it doesn't seem to work.
https://play.rust-lang.org/?gist=02e6b2d55eb675a1a7e6c0bdae90454d&version=stable&backtrace=0
I've asked Steve about it
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's now in a crate
https://crates.io/crates/unicode-segmentation
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.
@IanWhitney haha, that shows how long it's been since I've played with Rust. Code looks good to me, but now I am not so confident in my Rust review skills haha.
|
||
#[test] | ||
#[ignore] | ||
fn numbers_can_not_replace_numbers() { |
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.
numbers cannot replace letters, I presume
Implements the Pangram problem and follows the current canonical test
suite.