Clarify emoji complexity in the characters (char) exercise
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 90/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- documentation
Direzione di ricerca
Il file da modificare è exercises/04_primitive_types/primitive_types2.rs. Cerca la riga di commento che invita a provare un emoji. Aggiornala per chiarire l'uso di un emoji semplice e avvertire degli emoji composti. Verifica eseguendo l'esercizio con rustlings run primitive_types2 per assicurarti che il commento venga compilato e che il messaggio sia chiaro.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
While working on the characters (char) exercise, the instructions prompt the user to try an emoji:
// Try a letter, try a digit (in single quotes), try a special character, try a character from a different language than your own, try an emoji 😉
If a user tries a complex emoji like a heart on fire (❤️🔥) or a profession/gender-modified emoji, the compiler throws a character literal may only contain one codepoint error. This happens because these emojis are actually composed of multiple Unicode codepoints joined by Zero Width Joiners (ZWJ), which violates Rust's strict definition of a 4-byte single-codepoint char.
For beginners, this can be quite confusing since both 😉 and ❤️🔥 visually look like a single "character" in their text editor.
Describe the solution you'd like
I would like to update the comment in the exercise file to explicitly mention using a simple emoji (one that consists of a single codepoint) and briefly warn that composite emojis will cause a compilation error.
For example, updating the comment from:
// Try a letter, try a digit (in single quotes), try a special character, try a character
// from a different language than your own, try an emoji 😉
To something like:
// Try a letter, try a digit (in single quotes), try a special character, try a character
// from a different language than your own, try a simple emoji 😉 (avoid composite emojis
// like ❤️🔥 which consist of multiple Unicode codepoints!)
Describe alternatives you've considered
An alternative would be leaving it as is, but it frequently catches learners off guard when they choose a modern, multi-codepoint emoji from their system picker.
Additional context
Tested on Rust stable. The issue stems from the fundamental difference between a Rust char (a single Unicode Scalar Value) and an extended grapheme cluster.
Source: Exercice
https://github.com/rust-lang/rustlings/blob/main/exercises/04_primitive_types/primitive_types2.rs
Cargo version: cargo 1.98.1 (797e8a9bc 2026-08-05)
Rustlings version: rustlings 6.5.0
ls -la
total 60
drwxrwxr-x 7 devminds devminds 4096 sept. 22 12:59 .
drwxrwxr-x 4 devminds devminds 4096 sept. 22 12:57 ..
-rw-rw-r-- 1 devminds devminds 153 sept. 22 12:59 Cargo.lock
-rw-rw-r-- 1 devminds devminds 14591 sept. 22 12:57 Cargo.toml
drwxrwxr-x 27 devminds devminds 4096 sept. 22 12:57 exercises
drwxrwxr-x 7 devminds devminds 4096 sept. 22 12:57 .git
-rw-rw-r-- 1 devminds devminds 28 sept. 22 12:57 .gitignore
-rw-rw-r-- 1 devminds devminds 88 sept. 22 12:57 rust-analyzer.toml
-rw-rw-r-- 1 devminds devminds 210 sept. 22 19:32 .rustlings-state.txt
drwxrwxr-x 27 devminds devminds 4096 sept. 22 12:57 solutions
drwxrwxr-x 4 devminds devminds 4096 sept. 22 17:51 target
drwxrwxr-x 2 devminds devminds 4096 sept. 22 12:57 .vscode
OS
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.5 LTS"
PRETTY_NAME="Ubuntu 24.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.5 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
- Lingua principale
- Rust
- Stelle
- 64.6k
- Fork
- 11.3k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-lang/rustlings
-
A-exercises C-enhancement P-low
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
-
Proposal: German (Deutsch) translation for Community ExercisesForse di nuovo libera @mo8it l’ha presa 63 giorni fa e non c’è nessuna pull request aperta. Aperta
rust-lang/rustlings#2445 · 4 commenti · 2 reazioni · 1 assegnatario ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Tutte le issue di rust-lang/rustlings
Issue simili
-
Panic on live viewport resize when unstyled elements exist in display: none subtreeForse già presa @GoCoder7 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
DioxusLabs/blitz#1488 ·
I maintainer di solito rispondono entro 1 giorno
-
🏷️ good first issue enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
S-Needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
vectordotdev/vrl#2042 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno