Skip to content

Eliminate stub warnings#497

Merged
coriolinus merged 17 commits intoexercism:masterfrom
coriolinus:eliminate-unused-variable-warnings
Apr 8, 2018
Merged

Eliminate stub warnings#497
coriolinus merged 17 commits intoexercism:masterfrom
coriolinus:eliminate-unused-variable-warnings

Conversation

@coriolinus
Copy link
Copy Markdown
Member

Closes #484

Includes _test/check-stubs.sh, which discovers any compilation errors in the stubs.

Eliminates all stub warnings, not just unused variables.

simple-linked-list uses generics which are not bounded by Debug, so we can't use the standard "print it in unimplemented!() trick there. We fall back on underscore-prefixing affected variables in this case.

@coriolinus coriolinus changed the title Eliminate stub variable warnings Eliminate stub warnings Apr 8, 2018
Copy link
Copy Markdown
Member

@petertseng petertseng left a comment

Choose a reason for hiding this comment

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

some optional changes

Comment thread exercises/beer-song/src/lib.rs Outdated

pub fn sing(start: i32, end: i32) -> String {
unimplemented!()
unimplemented!("sing verses {} to {}", start, end)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could specify whether end is inclusive

Comment thread exercises/bob/src/lib.rs Outdated
@@ -1,3 +1,3 @@
pub fn reply(message: &str) -> &str {
unimplemented!()
unimplemented!("have bob reply to the incoming message: {}", message)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could write Bob not bob

@coriolinus coriolinus force-pushed the eliminate-unused-variable-warnings branch from 51b9efc to 1418849 Compare April 8, 2018 21:55
@coriolinus coriolinus merged commit f7d444a into exercism:master Apr 8, 2018
@coriolinus coriolinus deleted the eliminate-unused-variable-warnings branch April 8, 2018 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

use unimplemented! to reference variables, instead of having an unused variable warning

2 participants