-
Notifications
You must be signed in to change notification settings - Fork 543
prime-factors: Add solution template #440
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
Conversation
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.
Hi @neganp, thanks for this PR! It generally looks good, but I'd like you to make the change shown below so that there are no compile warnings when the student first downloads the exercise.
exercises/prime-factors/src/lib.rs
Outdated
@@ -0,0 +1,3 @@ | |||
pub fn factors(n: u32) -> Vec<u32> { | |||
unimplemented!() |
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.
Please update to reference n
so that there is no unused variable warning, like this.
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.
Oh nice! I didn't know you could do that. 👍
This way, the learner doesn't hit `unused variable` warnings when they first compile the example.
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.
Looks good, thanks!
I'm going to let this sit for a few days now so other maintainers have a chance to take a look and make their comments, but unless blocking changes are discovered, I intend to merge this on 5 Mar.
Cool, thanks! 🙂 |
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.
Yes.
I recommend squash when merging.
You have reminded me (or this PR caused me to remind myself, whichever wording you think is better) that in #269 we decided that all exercises should have stubs that allow running the tests, got it.
@neganp Have you reviewed your code? The test uses a big number which does not fit into rust/exercises/prime-factors/tests/prime-factors.rs Lines 42 to 44 in 80d2988
|
Oh, good catch. Weird that it passed all my tests 😕 It looks like a |
Wait, this doesn't even pass my tests; how embarrassing 😧 . |
This raises the question: why didn't Travis catch this?
…On Wed, Mar 14, 2018, 17:52 Nathaniel Knight ***@***.***> wrote:
Wait, this doesn't even pass my tests; how embarrassing 😧 .
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#440 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHdeTn5GVw1-1ND0N1thd7zykJtowT4Wks5teUrJgaJpZM4SVr-d>
.
|
I looks like some of the tests don't run on at least some of the builds: https://travis-ci.org/exercism/rust/jobs/347483074#L2213 |
I think that's a bug which we should fix. |
No description provided.