Instructions not clear for: `modules/modules2.rs`

Aperta
#1,346 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
48/100
Tipo di issue
Documentazione
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
rust
Ambito
documentation

Direzione di ricerca

Inizia leggendo modules/modules2.rs e il TODO relativo alle istruzioni use. Chiarisci che l'esercizio richiede sia le riesportazioni pubbliche con pub use sia gli alias fruit e veggie, quindi verifica che le istruzioni riviste rendano inequivocabile la modifica prevista.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A-exercises C-enhancement
// TODO: Fix these use statements
use self::fruits::PEAR as ???
use self::veggies::CUCUMBER as ???

// ... snip

fn main() {
    println!(
        "favorite snacks: {} and {}",
        delicious_snacks::fruit,
        delicious_snacks::veggie
    );
}

At first glance it seems as though the solution would simply be to replace the ??? with respective fruit and veggie;
However after much struggling and leaning on the rust discord community for assistance it was pointed out that the use statement itself should also be changed to pub use. This was not clear in the original problem, as the concept of making an import public is not one I'm accustomed to coming from other languages. The compiler doesn't event suggest this change, making it even more difficult to come to the correct answer without external assistance.

Lingua principale
Rust
Stelle
64.6k
Fork
11.3k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-lang/rustlings

Tutte le issue di rust-lang/rustlings

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.