Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exercises/bob/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[package]
name = "bob"
version = "1.0.0"
version = "1.1.0"
2 changes: 2 additions & 0 deletions exercises/bob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Bob answers 'Sure.' if you ask him a question.

He answers 'Whoa, chill out!' if you yell at him.

He answers 'Calm down, I know what I'm doing!' if you yell a question at him.

He says 'Fine. Be that way!' if you address him without actually saying
anything.

Expand Down
1 change: 1 addition & 0 deletions exercises/bob/example.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pub fn reply(message: &str) -> &str {
if is_silence(message) { "Fine. Be that way!" }
else if is_yelling(message) && is_question(message) { "Calm down, I know what I'm doing!" }
else if is_yelling(message) { "Whoa, chill out!" }
else if is_question(message) { "Sure." }
else { "Whatever." }
Expand Down
2 changes: 1 addition & 1 deletion exercises/bob/tests/bob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn test_using_acronyms_in_regular_speech() {
#[test]
#[ignore]
fn test_forceful_question() {
assert_eq!("Whoa, chill out!",
assert_eq!("Calm down, I know what I'm doing!",
bob::reply("WHAT THE HELL WERE YOU THINKING?"));
}

Expand Down