exercism / rust

Exercism exercises in Rust.
https://exercism.org/tracks/rust
MIT License
1.45k stars 520 forks source link

Implement new Concept Exercise: unit-structs #1068

Closed ghost closed 1 year ago

ghost commented 4 years ago

This issue describes how to implement the unit-structs concept exercise for the rust track.

Getting started

Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:

Please also watch the following video:

Goal

The goal is to teach the student what unit structs are and how one can use them. You'll also see them referred to as zero-width structs.

Learning objectives

Out of scope

Concepts

Prerequisites

Resources to refer to

Hints

After

Representer

No changes required

Analyzer

No changes required

Implementing

See our implementation guide for guidance. In addition you may want to make use of the shell script while in the concept directory, with the arg loops, e.g. sh boil_exercise.sh vec

Help

If you have any questions while implementing the exercise, please post the questions as comments in this issue.

gilescope commented 3 years ago

Are unit structs worth teaching specifically? I can think of many many things that would be more interesting/useful. If anything I might throw it in with PhantomData.

ghost commented 3 years ago

@gilescope great question. Curious, any topics come to mind? I'm with you though. In the less frequent Rust programming I do, I don't often use unit structs.

We originally intended to chart out a slew of basic concepts for the V3 track. As we develop the actual concept exercises some appear well-suited or not. This will be a good topic to cover in some fashion, but perhaps not prioritized for the top 20 issues we'll want for launch.