Reverse String: Confusing Hint for Bonus Tests

One of the first things you learn about Rust strings is that they are a valid UTF-8 sequence.

The hint about grapheme clusters made me question reality. The tools to iterate characters are there since 1.0.0, even though the random forum posts you find when googling “rust grapheme clusters” suggest something else.

IMHO, having such a niche big brain flex right in the first exercises isn’t helpful and steers you away from using a standard language feature. (That being being input.chars()) - Also, one of the tests outside of the grapheme feature is already using wide characters, so byte-by-byte reversing already fails without the bonus tests.

Ref:

I suggest to just remove the “Hint: grapheme clusters” and the sentence about the need for a crate. Calling the feature grapheme is alright, as this is the right place for gimmicky names.

I understand that this might’ve felt like the right place to introduce external crates.

1 Like

input.chars().rev() doesn’t work for the grapheme cluster test, so this hint is appropriate. The grapheme cluster thing is clearly marked as a bonus task. I think it’s fine for a bonus task to be a little challenging and make the user learn something new.

5 Likes

Note the practice exercises aren’t really ordered per se. You can do them in (m)any order.

input.chars().rev() doesn’t work for the grapheme cluster test

I just checked again and you’re right, I didn’t test with the feature enabled…

May have been a bit late yesterday, I’m so sorry!

1 Like