Skip to content

Eliminate stub warnings #497

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

Merged

Conversation

coriolinus
Copy link
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
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

}

pub fn sing(start: i32, end: i32) -> String {
unimplemented!()
unimplemented!("sing verses {} to {}", start, end)
Copy link
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

@@ -1,3 +1,3 @@
pub fn reply(message: &str) -> &str {
unimplemented!()
unimplemented!("have bob reply to the incoming message: {}", message)
Copy link
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