Clarify constructor return types for RNA Transcription exercise

I recently completed https:/exercism.org/tracks/rust/exercises/rna-transcription, but couldn’t quite figure out what the error type in the signatures of DNA::new() and RNA::new() was supposed to mean from looking at the tests. Unfortunately, I interpreted it as “the number of different nucleotides used before encountering the first invalid char”, which just so happened to pass the test cases, even though it was wrong. (I can submit a separate PR for fixing up those test cases.)

It turns out though that the usize in Result<Self, usize> was meant to mean “the first invalid character index”: https:/exercism.org/tracks/rust/exercises/rna-transcription

I opened this PR that clarifies the meaning of the error value in the return type. Any chance a language track maintainer could give this a look?

Looks good to me :+1:

It was already specified in the stub file, but of course those lines tend to be removed.

@senekor is the Rust track’s maintainer, I think.

LGTM as well. I’m not a maintainer though. Maybe @ErikSchierboom can reopen.

Approved and merged

1 Like