Skip to content

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

Closed
@petertseng

Description

@petertseng

We desire for our stubs to compile without warnings, as that helps us set a better example and prevent problems like #461 (a stub that provides a u32 where a u64 is needed).

In order for us to get there, these files that have unused variables should instead use the model established in #438 #474 and #477, where in the unimplemented! macro we write a message saying what the function should do and reference the arguments.

Here are the exercises that should be modified as a result of this (Determined via manual inspection of #478:

  • beer-song
  • bob
  • collatz-conjecture
  • difference-of-squares
  • forth
  • grade-school
  • grains
  • leap
  • pascals-triangle
  • perfect-numbers
  • proverb
  • raindrops
  • react
  • saddle-points
  • simple-linked-list
  • sum-of-multiples
  • two-bucket
  • variable-length-quantity

For each exercise, the relevant file is the src/lib.rs file. For example, https://github.com/exercism/rust/blob/master/exercises/bob/src/lib.rs for bob.

You may choose to either work on these one at a time, or send one PR that does this for all the exercises.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueAn improvement or bug fix that favors new contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions